Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^3: {Perl6} Macros and native compilation

by iblech (Friar)
on Apr 11, 2005 at 14:37 UTC ( [id://446623]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://446623]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-03-29 02:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found