<dbackeus>
where typeof would return Test? instead of Test
<dbackeus>
but I can't see how it could possibly be nil
<dbackeus>
can I force the compiler to not treat it as nilable or is there a good way of tracking down how the compiler believes it to be?
<jhass>
you can call .not_nil! which raises at runtime if it is in fact nil
<jhass>
but in your example it can't, right
<jhass>
so it's hard to judge from it where the possible nil in your real code comes from
<dbackeus>
thanks
salvor has quit [Changing host]
salvor has joined #crystal-lang
<salvor>
if you know the type of a variable and know if can't be nil at this point, you can also "var = var as MyType" to help the compiler a little
<salvor>
benefit = it can be used for other type problems as well
<dbackeus>
in ruby you can do [[1,2]].each { |x,y| ... } to "splat" a multidimensional array, is somethings similar possible in Crystal?
Ven has quit [Ping timeout: 246 seconds]
sandelius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sandelius has joined #crystal-lang
Ven has joined #crystal-lang
<dbackeus>
is there any way of dynamically constantizing a string in runtime (like active supports "Module::Class".constantize)?
zipR4ND has joined #crystal-lang
<zipR4ND>
hello, still fiddling with inheritance problems and class macros + constants. can you tell me how to solve this issue: http://carc.in/#/r/806
dbackeus has quit [Remote host closed the connection]
<jhass>
zipR4ND: maybe we can find a solution to your actual goal?
<salvor>
(you lose type information doing that tho, maybe you should refine that to your specific use case)
<dbackeus>
salvor: thanks for the hint, though I ended up working around the problem instead
<salvor>
ok ! was fun to try that anyway ;)
<zipR4ND>
jhass: my goal is to get this working: http://carc.in/#/r/80d the problem seems to be that the CHILDREN_NAMES and other constants are not uniqe for each class, so the definition of ASecondThing changes the children of AThing ... I want the class macros to work properly the way they are used in the example ...
<jhass>
ah, still trying to match a Ruby API 100% :/
<dzv>
how would i call c macros? or get sizeof(opaque structs) that vary between systems and versions? i could create c functions that wrap the macros and sizeof but i don't see a way to get that in to the build process