ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.29.0 | 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
_whitelogger has joined #crystal-lang
duane has joined #crystal-lang
moei has joined #crystal-lang
duane has quit [Ping timeout: 258 seconds]
ht_ has joined #crystal-lang
absolutejam has joined #crystal-lang
ht_ has quit [Quit: ht_]
moei has quit [Ping timeout: 248 seconds]
absolutejam has quit [Ping timeout: 244 seconds]
absolutejam has joined #crystal-lang
moei has joined #crystal-lang
sorcus has joined #crystal-lang
absolutejam has quit [Ping timeout: 248 seconds]
absolutejam has joined #crystal-lang
alex`` has quit [Quit: WeeChat 2.5]
absolutejam1 has quit [Quit: WeeChat 2.5]
laaron has joined #crystal-lang
absolutejam has quit [Ping timeout: 248 seconds]
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
absolutejam has joined #crystal-lang
laaron has quit [Client Quit]
laaron has joined #crystal-lang
laaron- has joined #crystal-lang
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
blassin278262 has joined #crystal-lang
blassin27826 has quit [Ping timeout: 245 seconds]
absolutejam1 has joined #crystal-lang
<absolutejam> how do I declare a property that's an anonymous func?
<absolutejam> of a class
<absolutejam> property of a class*
<absolutejam> func : Proc(Void) | Nil = nil
<absolutejam> :thumbsup:
<absolutejam> actually func : Proc(Void) = ->{ }
absolutejam1 has quit [Quit: WeeChat 2.5]
<jokke> does someone know if there's a way that math module functions raise a domain error?
laaron- has quit [Remote host closed the connection]
laaron has joined #crystal-lang
<jokke> ah ok it returns a NaN
duane has joined #crystal-lang
<jokke> is there a way to define a converter for an array field where the items of the array don't have a JSON::PullParser initializer so that i only need to implement the converter for the items?
absolutejam has quit [Read error: Connection reset by peer]
absolutejam has joined #crystal-lang
lucasb has joined #crystal-lang
DTZUZO has quit [Ping timeout: 258 seconds]
ht_ has joined #crystal-lang
absolutejam has quit [Ping timeout: 272 seconds]
laaron has quit [Remote host closed the connection]
return0e has quit [Read error: Connection reset by peer]
laaron has joined #crystal-lang
return0e has joined #crystal-lang
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 246 seconds]
DTZUZO has joined #crystal-lang
flaviodesousa has quit [Quit: KVIrc 4.9.3 Aria http://www.kvirc.net/]
dingenskirchen has quit [Quit: dingenskirchen]
dingenskirchen has joined #crystal-lang
absolutejam has joined #crystal-lang
absolutejam has quit [Ping timeout: 245 seconds]
absolutejam has joined #crystal-lang
DTZUZO has quit [Read error: Connection reset by peer]
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 248 seconds]
<absolutejam> can anyone point me in the right direction in regards to declaring a proc as an instance property and then instantiating it
<absolutejam> I currently have a custom type for the proc's args: `alias CommandFunc = Hash(Symbol, String) ->`
<absolutejam> on my class `property func : CommandFunc | Nil`
duane has quit [Ping timeout: 245 seconds]
devil_tux has quit [Ping timeout: 245 seconds]
absolutejam has quit [Ping timeout: 248 seconds]
<dingenskirchen> absolutejam, Is this what you're trying to do? https://play.crystal-lang.org/#/r/78jo
absolutejam has joined #crystal-lang
<absolutejam> and in addition to what I was saying, is a proc the best choice? I basically want crystal's equivalent of an anonymous function
laaron has quit [Remote host closed the connection]
<absolutejam> If a multiline proc works, I'll have that
<dingenskirchen> absolutejam, Is this what you're trying to do? https://play.crystal-lang.org/#/r/78jo
<dingenskirchen> (i posted that verbatim before but you seem to have been absent there)
<absolutejam> oh my bad. I get disconnected when I close the lid on my laptop
<absolutejam> I feel liek i had that - let me check
<absolutejam> oh, it works when I change my definition from...
<absolutejam> c.func = ->(opts : CommandFunc) { puts "foo" }
<absolutejam> to: ` c.func = ->(opts : hash(symbol, string)) { puts "foo" }`
<absolutejam> ignore the case ^ I think my editor clobbered it
<dingenskirchen> ^^
<absolutejam> second question - is this the right thing to do?
<absolutejam> a multiline proc seems weird as whenevery ou normally see this kinda thing, it's a block (do ... end vs { .. } over multiple lines)
<dingenskirchen> you can use a capture expression to write it as a do…end block: https://crystal-lang.org/reference/syntax_and_semantics/capturing_blocks.html
<absolutejam> hmmmm, sweet
<dingenskirchen> so something like this:
<absolutejam> yeah, I got it, thanks
<absolutejam> That's much better
frojnd has joined #crystal-lang
duane has joined #crystal-lang
lucasb has quit [Quit: Connection closed for inactivity]
ht_ has quit [Quit: ht_]
sorcus has quit [Ping timeout: 250 seconds]
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 245 seconds]
devil_tux has joined #crystal-lang
absolutejam has quit [Ping timeout: 258 seconds]
moei has quit [Quit: Leaving...]
return0e_ has joined #crystal-lang
return0e has quit [Ping timeout: 272 seconds]