<FromGitter>
<ohenepee> @j8r Your *if statement assignment* is nice... however concerning the `media` variable I fixed it by setting the type to `nil`... and no more compiler errors.
<FromGitter>
<proyb6> @S-YOU I did malloc it work but read_lines seems to be available for WinAPI, not exist in macOS?
akaiiro has quit [Ping timeout: 244 seconds]
DTZUZO has quit [Ping timeout: 245 seconds]
rohitpaulk has joined #crystal-lang
moei has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 245 seconds]
_whitelogger has joined #crystal-lang
akaiiro has joined #crystal-lang
akaiiro has quit [Remote host closed the connection]
lemur is now known as baweaver
<FromGitter>
<r00ster91> After I've set a read or write timeout for an IO, how do I remove the timeout again? Do I need to do `io.read_timeout = 999999` (so it's never reached) or is there a better way?
<FromGitter>
<bew> just set it to nil?
<FromGitter>
<r00ster91> oh thank you that works
Groogy1 has joined #crystal-lang
ashirase has quit [Ping timeout: 244 seconds]
ashirase has joined #crystal-lang
<FromGitter>
<ohenepee> @bew Is it wrong that I set it to `nil` ?
Groogy1 has quit [Ping timeout: 245 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter>
<bew> what?
rohitpaulk has quit [Ping timeout: 245 seconds]
<jokke>
is it possible to respond to a request with a 100 status code before receiving the body?
<FromGitter>
<bew> You can even specify a line with `path/to/spec.cr:line` iirc
DTZUZU has quit [Quit: WeeChat 1.9]
return0xe has quit [Remote host closed the connection]
return0xe has joined #crystal-lang
return0xe has quit [Ping timeout: 252 seconds]
_whitelogger has joined #crystal-lang
druonysus has quit [Ping timeout: 252 seconds]
<FromGitter>
<ohenepee> Hello everyone, in NodeJS there's an even we listen on just in case your app closes as a result of an unhandled exception its used to mostly perform clean-ups and prevent data loss (e.g. closing a DB) ⏎ ⏎ This is it `process.on("uncaughtException", functionHere)` ⏎ ⏎ How do I do something similar in Crystal, mind you this is not SIGTERM or SIGINT. [https://gitt
<FromGitter>
<j8r> Wrap your code in a `begin...; rescue; end`?
raz has joined #crystal-lang
return0e has joined #crystal-lang
<FromGitter>
<Prutheus> > Is there anything I should look out for, or be concerned about, if I have a web endpoint, and I throw a `spawn` in like this? ⏎ ⏎ Has someone an answer to that question?
<FromGitter>
<ohenepee> @j8r Will that work with Kemal's route handlers? That's what my actual problem is... if wrapping my entire code can catch exceptions from the route handlers
<FromGitter>
<mikejohnduran> Hello, I am interested in adding Crystal syntax highlighting for a text editor that currently doesn't support it, and could use some feedback on what the best approach would be. I thought about basing it from the existing Ruby one as a starting point and making modifications as I go. Does anyone have a better idea on how to go about this?
<FromGitter>
<vladfaust> @mikejohnduran take existing implementations for other editors and learn from them I guess?
<FromGitter>
<ohenepee> @vladfaust Yeah I seen this one (your reference) but I'm looking for something that can let me close my DB in the even of a fatal exception
<FromGitter>
<vladfaust> For compiler, there is no guarantee that *any* line within `begin` block would be run, therefore it assumes that no `read_file = ` is ever run
<FromGitter>
<vladfaust> Overcome is to do `puts app_config.not_nil!["head"]`
<FromGitter>
<vladfaust> Is there a way to make commented line work? /cc @asterite @RX14 @straight-shoota @bew sorry it's recursive types topic
<FromGitter>
<straight-shoota> @vladfaust You could add an overload to `Halt.new` which accepts an untyped `payload` argument and casts it to `Payload`
<FromGitter>
<proyb6> @straight-shoota Great find!
<FromGitter>
<proyb6> Interesting numbers: filter gists in Github on golang from Jan 2018 till present, what I found ⏎ Go has 9,340+ gists ⏎ Rust has 40K gists ⏎ Scala has 4.5K gists ⏎ C# has 45K gists ... [https://gitter.im/crystal-lang/crystal?at=5bb8f932600c5f64236370af]
<FromGitter>
<vladfaust> @proyb6 why are they interesting?
<FromGitter>
<HarrisonB> just kidding... using an explicit `nil` literal works.
robacarp has quit [Read error: Connection reset by peer]
<FromGitter>
<vladfaust> Hilarious :)
pabs has joined #crystal-lang
emilsp has quit [Read error: Connection reset by peer]
<FromGitter>
<bew> @HarrisonB what's the type of bar? Can't you do `{{ bar }}`
<FromGitter>
<bew> ?
Heaven31415 has joined #crystal-lang
<Heaven31415>
Hi
<FromGitter>
<HarrisonB> @bew in the event that `bar` is `nil`, `{{ bar }}` does not result in any ASTNode. Perhaps this is a bug I should report? But my guess is it's intentional
<FromGitter>
<bew> How did you get bar in this case?
<FromGitter>
<HarrisonB> oh actually, I believe you're right
<FromGitter>
<HarrisonB> it's because it's coming from `TypeDeclaration#value`
<FromGitter>
<HarrisonB> so it's a `Nop`
<FromGitter>
<bew> Ohok, i don't remember how nop behaves
<FromGitter>
<HarrisonB> it outputs an empty string at compile time
non-aristotelian has joined #crystal-lang
return0e has quit [Quit: Leaving]
<oprypin>
HarrisonB, well done figuring this out. i forgot about this detail
<FromGitter>
<HarrisonB> @oprypin thanks! :)
<FromGitter>
<cschiewek> I'm trying to get crystal up on Mojave, and I keep getting ssl errors. Specifically: `ld: library not found for -lssl (this usually means you need to install the development package for libssl)`. Is there homebrew package or config I'm missing?!
<FromGitter>
<cschiewek> Also, Hi! 👋
<Heaven31415>
Hi
<Heaven31415>
That is strange, I was doing a fresh install of Crystal on Mojave yesterday and everything worked fine in terms of ssl. However, maybe you should try this? https://formulae.brew.sh/formula/openssl@1.1
<FromGitter>
<cschiewek> Yeah, installing 1.1 and manually adding the LD paths to my zsh config fixed it
<FromGitter>
<cschiewek> Ty very much !
emilsp has joined #crystal-lang
<Heaven31415>
Cool, you are welcome.
return0e has joined #crystal-lang
return0e has quit [Ping timeout: 252 seconds]
return0e has joined #crystal-lang
<raz>
hmm. when i run 'shards build --production' it doesn't actually build production binaries (it neither adds --release nor --no-debug to the 'crystal build' invocation)