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
sagax has quit [Ping timeout: 244 seconds]
debayer has quit [Quit: if you can't play with it, why bother?]
sagax has joined #crystal-lang
ur5us has quit [Ping timeout: 244 seconds]
onyx has joined #crystal-lang
Sankalp has quit [Ping timeout: 252 seconds]
Sankalp has joined #crystal-lang
ur5us has joined #crystal-lang
ur5us has quit [Remote host closed the connection]
ur5us has joined #crystal-lang
notzmv has quit [Ping timeout: 244 seconds]
ur5us has quit [Ping timeout: 250 seconds]
Sankalp has quit [Ping timeout: 252 seconds]
Sankalp has joined #crystal-lang
Sankalp has quit [Ping timeout: 244 seconds]
Sankalp has joined #crystal-lang
notzmv has joined #crystal-lang
walez has joined #crystal-lang
walez has quit [Quit: Leaving]
Starfoxxes has quit [Ping timeout: 260 seconds]
Starfoxxes has joined #crystal-lang
walez__ has joined #crystal-lang
Starfoxxes has quit [Ping timeout: 265 seconds]
Starfoxxes has joined #crystal-lang
<FromGitter> <domgetter> How am I supposed to check if a hash has had a key associated with a value yet? I tried `if my_hash[some_key]?` but it raises that it's missing the hash key, which is of course the exact thing I'm trying to check.
<FromGitter> <RespiteSage> `Hash#[]?` should work... Can you give some example code?
<FromGitter> <domgetter> Sorry, I got flustered and thought I got the same error, but after changing [] to []?, it is now reporting the error on a further line down and I failed to read that.
<FromGitter> <RespiteSage> Oh, gotcha. No worries. :)
<FromGitter> <Blacksmoke16> `hash.has_key? some_key`
<FromGitter> <Blacksmoke16> if all you want is a bool of if it exists yet and dont care about the value
<FromGitter> <domgetter> Thanks for the help, it forced me to read the error more closely
<FromGitter> <Blacksmoke16> also if `false` is a valid value in your hash `if v = hash[some_key]?` would not work
<FromGitter> <RespiteSage> Could you do `unless (v = hash[some_key]?).nil?`?
<FromGitter> <domgetter> that makes sense
<FromGitter> <Blacksmoke16> if you dont care what the value is and just want to see if there *is* a value with a given key, just use `Hash#has_key?`
_ht has joined #crystal-lang
walez___ has joined #crystal-lang
walez__ has quit [Ping timeout: 264 seconds]
onyx has quit [Read error: Connection reset by peer]
hightower2 has joined #crystal-lang
ur5us has joined #crystal-lang
ur5us has quit [Ping timeout: 244 seconds]
ur5us has joined #crystal-lang
ur5us has quit [Ping timeout: 246 seconds]
_ht has quit [Quit: _ht]
oprypin has quit [Quit: No Ping reply in 180 seconds.]
oprypin has joined #crystal-lang
walez___ has quit [Quit: Leaving]
hightower3 has joined #crystal-lang
hightower2 has quit [Ping timeout: 260 seconds]
ur5us has joined #crystal-lang
oprypin has quit [Quit: Bye]
oprypin has joined #crystal-lang
ur5us has quit [Ping timeout: 244 seconds]
ur5us has joined #crystal-lang
ur5us has quit [Ping timeout: 264 seconds]