<BlaXpirit>
benoist, just that without it you wouldn't be able to use {{ }}
<benoist>
so it's what you need to create macro style code inside a instance method?
circ-user-bNaS0 has quit [Ping timeout: 244 seconds]
<benoist>
you just can't use function arguments in a macro style?
<BlaXpirit>
benoist, i think what you said is all correct
<BlaXpirit>
not entirely sure tho
<benoist>
perhaps there are more examples somewhere in the codebase
canhtak has quit [Quit: canhtak]
canhtak has joined #crystal-lang
<BlaXpirit>
there sure are, but it's all the same as this
<benoist>
hmm only when using Tuples
<jhass>
benoist: the new way of {% if true %}, if you look around you find more examples for that one, especially in Tuple
<jhass>
benoist: you do can use {{foo}} anywhere, but you would only at that point enter the macro language and what comes out needs to parse as a valid expression
<jhass>
benoist: so say we try new({{@type.type_vars.argify}}) inside class Foo(A, B); with Foo(String, Int32), it would generate "String, Int32", which is not valid crystal
<jhass>
benoist: with {% begin %} we can enter the macro language earlier, so the generated expression can become say new(String, Int32), which is valid Crystal and does parse
<BlaXpirit>
i really should've remembered that the last time you said it :p
<BlaXpirit>
seems worth a ?thing
<jhass>
mmh, could be hard to condense into one
<jhass>
but feel free to try to write one up
<benoist>
ok I think my assumptions were right then
<benoist>
is there any way to easily see the generated code via macros?
ssvb has quit [Ping timeout: 272 seconds]
<BlaXpirit>
yes, benoist, but i don't remember
<BlaXpirit>
easiest way is to make it be invalid xD
<BlaXpirit>
add a random bracket at the end
<benoist>
ah yeah that works, but only for the specific block, would be nice to see the whole file when using multiple macros :)
<BlaXpirit>
?iftrue=Code that is expanded from a top-level macro expression must be valid Crystal. That's why {% if true %} or {% begin %} are used. Example: https://github.com/manastech/crystal/blob/c6ab2f1/src/tuple.cr#L263 - `Tuple.new( self[0].clone, self[1].clone, )` is valid code, while `self[0].clone, self[1].clone,` is not.
<DeBot>
BlaXpirit: Set iftrue.
<benoist>
nice :)
<crystal-gh>
[crystal] ysbaddaden opened pull request #1819: Reseed PRNG after fork (master...std-random-new-seed) http://git.io/vW22D
<jhass>
benoist: {{debug()}} when inside the macro language (or only inside a macro? idk). crystal tool browser if your code lives inside a called method
leafybasil has quit [Remote host closed the connection]
kgadek has quit [Read error: Connection reset by peer]
circ-user-bNaS0 has joined #crystal-lang
kgadek has joined #crystal-lang
Raimondii has quit [Quit: The road to wisdom?—Well, it's plain and simple to express: Err and err and err again, but less and less and less. — Piet Hein]
Raimondi has joined #crystal-lang
NeverDie has joined #crystal-lang
kgadek has quit [Ping timeout: 246 seconds]
me has joined #crystal-lang
me is now known as x11
x11 is now known as Guest87551
Guest87551 is now known as bx11
circ-user-bNaS0 has quit [Ping timeout: 264 seconds]
circ-user-bNaS0 has joined #crystal-lang
pawnbox_ has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
kgadek has joined #crystal-lang
bx11 has quit [Remote host closed the connection]
kgadek_ has joined #crystal-lang
kgadek has quit [Read error: Connection reset by peer]
trapped has joined #crystal-lang
trapped has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
edaaa_ has joined #crystal-lang
circ-user-bNaS0 has quit [Ping timeout: 250 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
dylanmei has quit [Quit: ZZZzzz…]
kgadek_ has quit [Quit: gone sleep]
barosl has quit [Read error: Connection reset by peer]
kgadek has joined #crystal-lang
kgadek has quit [Quit: gone sleep]
zz_Cidan is now known as Cidan
pawnbox_ has joined #crystal-lang
barosl has joined #crystal-lang
trapped has joined #crystal-lang
pawnbox has quit [Ping timeout: 246 seconds]
Cidan is now known as zz_Cidan
bx11 has joined #crystal-lang
canhtak has quit [Quit: canhtak]
canhtak has joined #crystal-lang
reed_ has joined #crystal-lang
zz_Cidan is now known as Cidan
edaaa_ has quit [Ping timeout: 240 seconds]
pawnbox_ has quit [Ping timeout: 244 seconds]
pawnbox has joined #crystal-lang
bx11 has quit [Remote host closed the connection]
bx11 has joined #crystal-lang
pawnbox has quit [Read error: Connection reset by peer]
trapped has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pawnbox has joined #crystal-lang
pawnbox_ has joined #crystal-lang
edaaa_ has joined #crystal-lang
pawnbox has quit [Ping timeout: 252 seconds]
pawnbox_ has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 246 seconds]
<benoist_>
is there a way to call previous_def or if previous_def does not exists to call super?
<jhass>
benoist_: start with def foo; super; end ?