|
6macros: discussing the finer points of Perl 6 macros, Qtrees, and how to stay sane | irclog: irclog.perlgeek.de/6macros/today Set by moderator on 28 July 2015. |
|||
|
04:45
ilbot3 joined
07:09
vendethiel joined
08:18
FROGGS joined
|
|||
| masak | .run is just "what a Q::Statement node does at runtime when control reaches it" | 08:20 | |
| I guess the reason it, too, isn't called .eval is that 007 happens to believe in the separation of Expr and Statement | |||
| and so there isn't really a return value | 08:21 | ||
|
08:30
pdcawley joined
|
|||
| masak | $ perl6 bin/007 -e='macro moo() { return Q::Statement::Return { expr: "OH HAI" } }; sub foo() { moo(); return "never reached" }; say(foo())' | 08:33 | |
| Method 'eval' not found for invocant of class 'Q::Statement::Return' | |||
| dang, that should work :) | |||
| that's supposed to inject an *unhygienic* `return` into foo | |||
|
09:36
Ven joined
|
|||
| masak | hm, I think the Q::Expr::Block hack can go away, when we put the lookup magic in identifiers. | 09:38 | |
| we'll still need to tackle the impedance mismatch for quasis (inside looks like a statementlist, outside looks like an expression), but that shouldn't require a solution as heavy-handed as Q::Expr::Block | |||
|
09:58
Ven joined
11:04
pdcawley_ joined
|
|||
| masak | you know what we should try out in a branch? | 12:15 | |
| stuffing the whole Q hierarchy inside of Val::Object :D | |||
|
12:22
Ven joined
|
|||
| Ven | rust macros in action! github.com/sgrif/diesel | 13:41 | |
| masak | cute :) | 13:43 | |
|
18:16
pdcawley joined
22:33
cgfbee joined
|
|||