faustinoaq changed the topic of #amber to: Welcome to Amber Framework community! | https://amberframework.org | Developer happiness, productivity and bare metal performance | GH: https://github.com/amberframework | Docs: https://docs.amberframework.org | Gitter: https://gitter.im/amberframework/amber | IRC Logger: https://irclog.whitequark.org/amber | Amber::Server.start
_whitelogger has joined #amber
_whitelogger has joined #amber
feepbot has quit [Ping timeout: 268 seconds]
feepbot has joined #amber
_whitelogger has joined #amber
<FromGitter> <charleystran> I ended up tracing down my error and fixing it. Thank you for the help yesterday
<FromGitter> <charleystran> I am still pretty new to crystal and could use some help trying to sort an array of objects. I am trying to call this `sorted.sort{|a, b| a.score <=> b.score }` but I get an error like this `no overload matches 'Float64#>' with type (Float64 | Nil)` Even though the score is never nil, but I think at compile time it doesnt know that? the attribute was declared by `getter score : (Float64 | Nil)`
<robacarp> you can either make your sort comparison nil friendly, or deal with the nils ahead of time
<robacarp> I'd recommend the latter
<robacarp> you can #compact both your arrays which will remove all nils
<robacarp> (and, more importantly, the compiler type attribute that there could be a nil)
Anderlok has joined #amber
Anderlok has left #amber [#amber]