Skip to content

Instantly share code, notes, and snippets.

@masak
Created April 18, 2009 11:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masak/97553 to your computer and use it in GitHub Desktop.
Save masak/97553 to your computer and use it in GitHub Desktop.
my $invocant := $( $/[0] );
my $call := $( $/[1] );
# [...]
# We only want to evaluate invocant once; stash it in a register.
$call.unshift(PAST::Op.new(
:pasttype('bind'),
PAST::Var.new(
:name('detemp'),
:scope('register'),
:isdecl(1)
),
$invocant
));
# Question: if I know that $invocant will be '$_', how do I change the above?
# Does the string '$_' suffice?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment