<aladagemre>
when we have struct S; type T = S; and a function expecting pointer of T as argument, how can we create new T object and send its reference to the function?
<jhass>
T.new as well as S.new as T should work
<jhass>
or use alias instead of type and it should be accepted implicitly
<aladagemre>
well it says T doesn't have method new when I say T.new. when I try to cast, it says S can't be casted to T. I am using struct/type from C-binding
<BlaXpirit>
aladagemre, i haven't seen any case where you'd need to make a distinct copy of a struct
<BlaXpirit>
unless you explain, i assume you're misusing this `type`thing, and should be using alias instead
trajing has joined #crystal-lang
<aladagemre>
thanks, that was useful. I guess the code created by crystal_lib created unecessary type T = S and then used T* everywhere. I replaced T* with S* in the code and it worked
<BlaXpirit>
aladagemre, i'd like to see that
<BlaXpirit>
what it created and based on what
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<aladagemre>
BlaXpirit: ok I will be sharing them soon
Ven has joined #crystal-lang
aladagemre has quit [Remote host closed the connection]
trapped has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
trapped has joined #crystal-lang
Excureo has joined #crystal-lang
trapped has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
daveshah has quit [Ping timeout: 240 seconds]
fowlduck has joined #crystal-lang
fowlduck has quit [Ping timeout: 256 seconds]
Sadin has joined #crystal-lang
Ven has quit [Ping timeout: 256 seconds]
globalkeith has joined #crystal-lang
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 250 seconds]
shama has joined #crystal-lang
slash_join is now known as slash_mode
globalkeith has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
daveshah has joined #crystal-lang
fowlduck has joined #crystal-lang
Sadin has quit [Read error: Connection reset by peer]
fowlduck has quit [Ping timeout: 256 seconds]
Sadin has joined #crystal-lang
Ven has joined #crystal-lang
thor77 has joined #crystal-lang
<thor77>
is anyone solving AoC in crystal?
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Renich has joined #crystal-lang
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 272 seconds]
Ven has joined #crystal-lang
trapped has joined #crystal-lang
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
globalkeith has joined #crystal-lang
trapped has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Ven has joined #crystal-lang
Ven has quit [Client Quit]
<thor77>
is there an equivalent to ruby's "eval" in crystal?
<jhass>
no
<jhass>
think about it for a while and you realize why
<thor77>
:(
<jhass>
or ask the same question for C
<thor77>
done
<thor77>
ty :)
* thor77
slaps thor77 and starts getting carried away
Sadin has quit [Ping timeout: 250 seconds]
tomchapin has joined #crystal-lang
<BlaXpirit>
thor77, heh asterite is solving AoC
<BlaXpirit>
also u shouldnt abbreviate that
<thor77>
BlaXpirit: y?
<thor77>
asterite: how did you solve day8 without eval?