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
ur5us_ has quit [Ping timeout: 268 seconds]
ur5us_ has joined #crystal-lang
deavmi has quit [Read error: Connection reset by peer]
deavmi has joined #crystal-lang
ur5us_ has quit [Ping timeout: 268 seconds]
cenan has joined #crystal-lang
sagax has quit [Read error: Connection reset by peer]
ur5us_ has joined #crystal-lang
cenan has quit [Quit: Leaving]
ur5us_ has quit [Ping timeout: 240 seconds]
hightower3 has joined #crystal-lang
hightower2 has quit [Ping timeout: 252 seconds]
<mps> Blacksmoke16: re: xml to json https://github.com/mamantoha/xml_converter
<mps> works fine in some of my tests
<FromGitter> <Blacksmoke16> oh nice!
<FromGitter> <Blacksmoke16> only in some? 😬
<mps> well, didn't tested it extensively, don't need to process big xmls
<mps> actually worked in all small tests I made
<FromGitter> <Blacksmoke16> 👍 good to hear
hightower4 has joined #crystal-lang
hightower3 has quit [Ping timeout: 260 seconds]
repo has joined #crystal-lang
Guest30 has joined #crystal-lang
Guest30 has quit [Client Quit]
Welog has quit [Read error: Connection reset by peer]
ur5us_ has joined #crystal-lang
ur5us_ has quit [Ping timeout: 265 seconds]
<FromGitter> <nanobowers> kind of a general question about crystal APIs (vs ruby): where in ruby it might be common to return nil from a function when something failed - this seems like a pain Crystal from a usage standpoint. One could make the function return `Foo?` instead of `Foo`, but then the user would have to either handle the Nil case on their side using `.try` or otherwise. It seems the preferred approach is to raise
<FromGitter> ... Exceptions? Particular case in point: parsing a string to generate a Foo, but parsing fails. ⏎ ⏎ Relatedly, i'd be interested to buy a book about "The Crystal Way", b/c the more I spend time in Crystal I can see the Ruby way is not the right way for crystal. The documentation is great and a lot can be gleaned from reading s ... [https://gitter.im/crystal-lang/crystal?at=6141130a63dca818915d1d51]
ur5us_ has joined #crystal-lang
SamantazFox has quit [Ping timeout: 250 seconds]
SamantazFox has joined #crystal-lang
<FromGitter> <Blacksmoke16> you'd still have to handle `nil` in ruby, it just doesn't warn you where it's possible it *could* be `nil`
<FromGitter> <Blacksmoke16> Crystal way would be to have a `#parse` and `#parse?` method where the first raises and the latter returns nil
<FromGitter> <Blacksmoke16> if you find yourself doing like ⏎ ⏎ ```if value = some_method ⏎ value ⏎ else ⏎ some_default ⏎ end``` [https://gitter.im/crystal-lang/crystal?at=61411c2bf3449e13a47291f3]
<FromGitter> <Blacksmoke16> as using exceptions for control flow isn't great
hightower3 has joined #crystal-lang
hightower4 has quit [Ping timeout: 268 seconds]