|
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 25 February 2015. |
|||
|
02:49
ilbot3 joined
|
|||
| moderator | 6macros: discussing the finer points of Perl 6 macros, Qtrees, and how to stay sane | irclog: irclog.perlgeek.de/6macros/today | ||
|
08:37
Mouq joined
09:52
Ven joined
|
|||
| masak | I got that question too. decided to politely decline. | 09:54 | |
| Ven | well, I first can't afford it and secondly I "school" both on week and weekend days...:) | 09:55 | |
| masak | *nod* | 09:56 | |
|
11:01
Ven joined
12:46
Ven joined
|
|||
| Ven | Smalltalk is *really* interesting | 13:11 | |
| just like a lisp, it's funny how overlooked it is | |||
|
14:13
Ven joined
|
|||
| Mouq | m: sub given($val) { $OUTER::_ = $val }; given('a'); .say | 16:01 | |
| ww | |||
| :P | |||
| Ven | well, once again, hygiene proved to be a problem :P | 16:26 | |
| Mouq | "my $m = 42; macro out { quasi { $m = 5 } }; say out" "Cannot assign to an immutable value" Should this work? | 16:30 | |
| m: say $*IN.encoding | 16:33 | ||
| Damnit | |||
| I'm out of it today | |||
| Ven | no, this shouldn't. the macro should have its own lexical scope | 16:34 | |
| it should be COMPILING::$m by the current spec, iirc | |||
| Mouq | Ven: Ahh, yes, that makes much more sense. And it does indeed work | 16:35 | |
| Ven | :) | 16:36 | |
| that doesn't work for me, though.. | |||
| my $a = 5; macro foo($val) { quasi { $COMPILING::a = {{{$val}}}; } }; foo('bar'); say $a | 16:37 | ||
| Mouq | Oh, you're right. I was just checking the macro's output value… | 16:38 | |
| This is relevant for macro given, btw | |||
| masak | you're allowed to assign to $m there, yes. | 16:52 | |
| I haven't seen the "Cannot assign to an immutable value" thing before. | |||
| that used to work, at least. | |||