ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.31.1 | Fund Crystal's development: http://is.gd/X7PRtI | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Gitter: https://gitter.im/crystal-lang/crystal
ur5us_ has quit [Ping timeout: 268 seconds]
<FromGitter> <Blacksmoke16> TIL you can send the response obj back to the client then do other stuff
<FromGitter> <Blacksmoke16> makes sense since its just an IO i guess, but never really thought about it
<FromGitter> <Blacksmoke16> any other useful events i should implement?
<FromGitter> <Blacksmoke16> currently i have ⏎ ⏎ 1) request - after a route has been resolved ⏎ 2) action_arguments - after the controller's action's arguments have been resolved ⏎ 3) response - after the controller's action has been executed ... [https://gitter.im/crystal-lang/crystal?at=5ddf137c6a85195b9eba201b]
<FromGitter> <Blacksmoke16> was thinking maybe one more between response and terminate that includes the controller action's response value?
<FromGitter> <Blacksmoke16> which could be used for like writing the return value to the response, say based on what format the response should be etc, whicher listener sets it first is it
<raz> hmm, is there a sane way to make an Enum json-serialize to strings (and back)?
<FromGitter> <watzon> Provide to_json and from_json methods for it
<FromGitter> <watzon> Or actually I think you may need `new(json : JSON::PullParser)` rather than `from_json`
<raz> hmm yea, i found someone who tried the opposite: https://github.com/crystal-lang/crystal/issues/2291
<raz> i guess i'm just not sure how to map the names back in from_json
<raz> gonna experiment a bit
<FromGitter> <Blacksmoke16> MyEnum
<FromGitter> <Blacksmoke16> .parse?
<raz> you mean invent my own enum macro?
<raz> i generally just want it for one specific enum and preferably without too much black magic ;)
<raz> if it's too complicated i'll prob just stick with an int in the json
<FromGitter> <Blacksmoke16> no i mean define a `from_json` method and do like `MyEnum.parse? json.read_string` or something like that
<FromGitter> <Blacksmoke16> can even make the module like `EnumConverter(MyEnum)` then `T.parse? json read_string`
<raz> hmm gonna try, thx!
<FromGitter> <Daniel-Worrall> Can't you just use a converter
<FromGitter> <Blacksmoke16> That's what I was suggesting
<FromGitter> <Blacksmoke16> I don't think one exists in the std lib
<FromGitter> <Daniel-Worrall> Yeah make one yourself and specify it on the serialize stuff
hightower4 has quit [Ping timeout: 252 seconds]
Human_G33k has quit [Ping timeout: 265 seconds]
Human_G33k has joined #crystal-lang
f1reflyylmao has joined #crystal-lang
f1refly has quit [Ping timeout: 250 seconds]
<FromGitter> <Blacksmoke16> mhm
<FromGitter> <christopherzimmerman> Anyone come across a shard for reading hd5?
<FromGitter> <Blacksmoke16> whats the reasoning for having `Exception`, but naming everything `*Error`?
<FromGitter> <Blacksmoke16> `ArgumentError` vs `ArgumentException`
<FromGitter> <Blacksmoke16> er i guess because it represents and argument error but is of type `Exception`
yukai has joined #crystal-lang
chachasmooth has quit [Ping timeout: 246 seconds]
chachasmooth has joined #crystal-lang
ht_ has joined #crystal-lang
ht_ has quit [Quit: ht_]
yukai has quit [Ping timeout: 265 seconds]
alexherbo2 has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 240 seconds]
alexherbo2 has joined #crystal-lang
dwdv has joined #crystal-lang
FromGitter has quit [Read error: Connection reset by peer]
FromGitter has joined #crystal-lang
hightower3 has joined #crystal-lang
alexherbo21 has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 265 seconds]
<FromGitter> <vlazar> Anybody here on MacOS? Something very weird happens with Crystal for me locally. ⏎ ⏎ ```if rand(2) > 0 ⏎ my_string = "hello world" ⏎ end ⏎ ⏎ puts my_string``` ⏎ ⏎ And it happily compiles and runs without any errors. ... [https://gitter.im/crystal-lang/crystal?at=5ddfb58b6a85195b9ebe6c98]
<FromGitter> <vlazar> I've noticed it when I've changed var name `my_string` to `greeting` and was confused why there was no compile time error.
<FromGitter> <igor-alexandrov> It works for me too
<FromGitter> <vlazar> I've tried using `my_string` and Crystal did shonw a comile time error.
<FromGitter> <vlazar> ANd now it just always runs.
<FromGitter> <vlazar> @igor-alexandrov Work as in it incorrectly compiles and runs?
<FromGitter> <igor-alexandrov> yes
<FromGitter> <vlazar> 1) 31.1?
<FromGitter> <igor-alexandrov> Crystal 0.31.1 (2019-10-02) ⏎ ⏎ LLVM: 8.0.1 ⏎ Default target: x86_64-apple-macosx [https://gitter.im/crystal-lang/crystal?at=5ddfb621f65fec1c8e8567be]
<FromGitter> <igor-alexandrov> It also works on 0.30.0: https://play.crystal-lang.org/#/r/8399
DTZUZO has quit [Ping timeout: 240 seconds]
<FromGitter> <vlazar> Thanks for confirmation, created an issue https://github.com/crystal-lang/crystal/issues/8530
<FromGitter> <vlazar> Actually, shouldn't `puts nil` work?
<FromGitter> <vlazar> Maybe it's not an issue with compiler, but incorrect example.
<FromGitter> <vlazar> Oh, it's actually funnier that that. I've tested it before in carcin and it was showing a compile time error for me. Now it also works similarly to how it was a compile time error before for me locally and now it always runs with no error.
<FromGitter> <vlazar> Ignore me guys, lost the `.upcase` part in code
<FromGitter> <igor-alexandrov> :)
<FromGitter> <vlazar> time for some sleep I guess :D
<FromGitter> <vlazar> still, I'm workin on presentation, and that's a plus
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 240 seconds]
DTZUZO has joined #crystal-lang
DTZUZO has quit [Remote host closed the connection]
DTZUZO has joined #crystal-lang
erdnaxeli has quit [Remote host closed the connection]
tleydxdy has quit [Write error: Connection reset by peer]
olbat[m] has quit [Remote host closed the connection]
ternarysolo has quit [Remote host closed the connection]
beepdog has quit [Write error: Connection reset by peer]
alexherbo21 has quit [Quit: The Lounge - https://thelounge.chat]
alexherbo2 has joined #crystal-lang
<hightower3> fg
olbat[m] has joined #crystal-lang
tleydxdy has joined #crystal-lang
beepdog has joined #crystal-lang
ternarysolo has joined #crystal-lang
erdnaxeli has joined #crystal-lang
alexherbo20 has joined #crystal-lang
alexherbo2 has quit [Read error: Connection reset by peer]
DTZUZO has quit [Ping timeout: 265 seconds]
DTZUZO has joined #crystal-lang
ht_ has joined #crystal-lang
HumanGeek has joined #crystal-lang
HumanGeek has quit [Remote host closed the connection]
HumanGeek has joined #crystal-lang
Human_G33k has quit [Ping timeout: 240 seconds]
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Nekka has quit [Ping timeout: 240 seconds]
Nekka has joined #crystal-lang
alexherbo208 has joined #crystal-lang
alexherbo20 has quit [Ping timeout: 265 seconds]
dannyAAM has quit [Quit: znc.saru.moe : ZNC 1.6.2 - http://znc.in]
dannyAAM has joined #crystal-lang
Nekka has quit [Read error: Connection reset by peer]
alexherbo208 has quit [Ping timeout: 268 seconds]
alexherbo208 has joined #crystal-lang
Nekka has joined #crystal-lang
alexherbo208 has quit [Client Quit]
teardown is now known as netbastard
alexherbo2 has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 268 seconds]
alexherbo25 has joined #crystal-lang
alexherbo25 has quit [Client Quit]
alexherbo2 has joined #crystal-lang
alexherbo2 has quit [Client Quit]
alexherbo2 has joined #crystal-lang
Nekka has quit [Read error: Connection reset by peer]
Nekka has joined #crystal-lang
alexherbo27 has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 276 seconds]
alexherbo27 has quit [Client Quit]
Yxhuvud has joined #crystal-lang
<FromGitter> <Daniel-Worrall> Is there interest in providing a circleci template with `crystal init`, just as we do with travis?
<FromGitter> <Daniel-Worrall> Threw it up #8532
<DeBot> https://github.com/crystal-lang/crystal/issues/8532 (CircleCI config on init tool)
ht_ has quit [Remote host closed the connection]
blueberrypie has joined #crystal-lang
yukai has joined #crystal-lang