in reply to Re^2: {Perl6} Macros and native compilation
in thread {Perl6} Macros and native compilation

I'd say you'd have to use single quotes, e.g.:

my macro this { 'self{$foo}' }

I don't think rg0now's idea will work, because $foo would refer to some outer $foo. If my understanding is correct, you can do things like the following:

my $compilation_time = BEGIN { time }; macro uptime { time - $compilation_time } # And then... say "$*PROGRAM_NAME has been running for {uptime} seconds.";

(Update: Doing s/macro/sub/ here would work just fine, too.)

But, as rg0now said, that may be wrong, of course.

--Ingo