havenwood has quit [Remote host closed the connection]
havenwood has joined #crystal-lang
ismael__ has joined #crystal-lang
ismaelga has quit [Ping timeout: 250 seconds]
havenwood has quit []
ismael__ has quit [Remote host closed the connection]
ponga has joined #crystal-lang
<epitron>
slop!
<epitron>
does crystal not have a datastructure that can store mixed types?
ponga has quit [Quit: Leaving...]
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 252 seconds]
Ven has joined #crystal-lang
<jhass>
epitron: mixed types (aka unions), yes. Arbitrary types (=unknown which will end up in it until runtime), no
leafybasil has quit [Remote host closed the connection]
leafybasil has joined #crystal-lang
leafybasil has quit [Remote host closed the connection]
leafybasil has joined #crystal-lang
canhtak has joined #crystal-lang
Ven_ has joined #crystal-lang
Ven has quit [*.net *.split]
Excureo has quit [*.net *.split]
leex has quit [*.net *.split]
dom96 has quit [*.net *.split]
leex has joined #crystal-lang
dom96 has joined #crystal-lang
Excureo has joined #crystal-lang
irclogger_______ has quit [*.net *.split]
vifino has quit [*.net *.split]
leafybasil is now known as 21WABQM66
leafybasil has joined #crystal-lang
irclogger_______ has joined #crystal-lang
vifino has joined #crystal-lang
21WABQM66 has quit [Ping timeout: 265 seconds]
canhtak has quit [Quit: canhtak]
bcardiff has joined #crystal-lang
bcardiff has quit [Quit: Leaving.]
Ven_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
canhtak has joined #crystal-lang
ismaelga has joined #crystal-lang
asterite has joined #crystal-lang
ismaelga has quit [Remote host closed the connection]
<asterite>
epitron: we talked many times about letting you use Object or Reference for "Any". For example, a = [] of Object; a << 1; a << "hello"; But then to use each object you always have to cast it, so it would be like a void* in C
leafybasil has quit [Remote host closed the connection]
leafybasil has joined #crystal-lang
havenwood has joined #crystal-lang
Ven has joined #crystal-lang
ponga has joined #crystal-lang
canhtak has quit [Quit: canhtak]
ismaelga has joined #crystal-lang
canhtak has joined #crystal-lang
bcardiff has joined #crystal-lang
asterite has quit [Quit: Leaving.]
asterite has joined #crystal-lang
shama has joined #crystal-lang
<epitron>
hmmm
<epitron>
asterite: I see... well, in the option parser DSLs, you usually specify the type..
<asterite>
Yes, but if you store it in a hash then when you get the value out of it you must specify the type again
<epitron>
okay... so it has to generate an object to store the values I guess
<asterite>
I think that in that case you can have a Hash(String, Int32 | Float64 | String | Bool) for example, no need to use Object, but you'd have to cast the type afterwards. But it can be done like opt.int("flag")
<asterite>
In any case, I think OptionParser is more flexible: you get the passed value and you can do whatever you want with it. Want an int? Invoke .to_i. It's not that much code :)
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
havenwood has quit [Remote host closed the connection]
bcardiff1 has joined #crystal-lang
bcardiff has quit [Ping timeout: 246 seconds]
asterite1 has joined #crystal-lang
canhtak has quit [Quit: canhtak]
asterite has quit [Ping timeout: 265 seconds]
eli-se has joined #crystal-lang
leafybas_ has joined #crystal-lang
leafybas_ has quit [Remote host closed the connection]
ponga has quit [Quit: Leaving...]
leafybasil has quit [Ping timeout: 246 seconds]
bcardiff has joined #crystal-lang
bcardiff1 has quit [Ping timeout: 250 seconds]
ismaelga has quit [Remote host closed the connection]
leafybasil has joined #crystal-lang
leafybasil has quit [Ping timeout: 272 seconds]
bcardiff has quit [Quit: Leaving.]
asterite1 has quit [Quit: Leaving.]
asterite has joined #crystal-lang
asterite has quit [Quit: Leaving.]
bcardiff has joined #crystal-lang
bcardiff has quit [Ping timeout: 272 seconds]
<epitron>
a nice simple DSL for parsing args would be great though