ChanServ changed the topic of #crystal-lang to: The Crystal programming language | https://crystal-lang.org | Fund Crystal's development: https://crystal-lang.org/sponsors | GH: https://github.com/crystal-lang/crystal | Docs: https://crystal-lang.org/docs | Gitter: https://gitter.im/crystal-lang/crystal
ua_ has joined #crystal-lang
dostoyevsky2 has quit [Quit: leaving]
dostoyevsky2 has joined #crystal-lang
ua__ has joined #crystal-lang
ua_ has quit [Ping timeout: 268 seconds]
ur5us has quit [Ping timeout: 268 seconds]
postmodern has joined #crystal-lang
<FromGitter> <shomodj> Hey, how do I get user id that is running the program from crystal?
<postmodern> so how do you handle recursive block expansion? I'm porting some Ruby code which defines Set Operator classes which are initialized with an Enumerable(String) and define #each(&block : (String) ->), but crystal is complaining about how this can lead to infinite inlining
<postmodern> shomodj, doesn't look like crystal binds in lib'c getuid, but you can add it yourself
<postmodern> ```lib Lib; fun getuid() : LibC::Int; end``` something like that
<postmodern> is there a crystal equivalent to ruby's String#swapcase ?
<postmodern> hmm also i guess it's by design that there's no String#to_sym method?
<postmodern> i guess i could convert this code to use an Enum, but i have this code which infers the default language code from the $LANG env variable, which means it potentially might return a language my Enum doesn't support
postmodern has quit [Quit: Leaving]
<yxhuvud> postmodern: Yes, symbols are always known at compile time. No dynamic creation of new ones are possible.
<FromGitter> <shomodj> thanks postmodern, will give it a try
ua__ has quit [Ping timeout: 260 seconds]
ua_ has joined #crystal-lang
<FromGitter> <Blacksmoke16> would like `System::User.find_by(name: System::User.username).id` work? Not super straightforward tho
Elouin has quit [Quit: Ping timeout (120 seconds)]
Elouin has joined #crystal-lang
hightower2 has quit [Ping timeout: 268 seconds]
hightower2 has joined #crystal-lang
<FromGitter> <shomodj> ```code paste, see link``` ⏎ ⏎ this works, will try and add it to crystal later [https://gitter.im/crystal-lang/crystal?at=61840f7138377967f49211fd]
hightower2 has quit [Ping timeout: 260 seconds]
hightower2 has joined #crystal-lang
hightower2 has quit [Ping timeout: 256 seconds]
hightower2 has joined #crystal-lang
hightower2 has quit [Ping timeout: 268 seconds]
ur5us has joined #crystal-lang
hightower2 has joined #crystal-lang
hightower2 has quit [Ping timeout: 256 seconds]
<straight-shoota> There's already a (stale) PR for that: https://github.com/crystal-lang/crystal/pull/7822
yxhuvud has quit [Remote host closed the connection]
hightower2 has joined #crystal-lang
yxhuvud has joined #crystal-lang
<FromGitter> <shomodj> @straight-shoota yikes :(
<FromGitter> <shomodj> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=61846b90a41fd206992456d2]
<FromGitter> <Blacksmoke16> ```if b = foo.bar ⏎ # b is not nil ⏎ end``` [https://gitter.im/crystal-lang/crystal?at=61846c342197144e84a81d1b]
<FromGitter> <shomodj> @Blacksmoke16 thanks, will read up
richbridger has joined #crystal-lang