Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Perlito5 - perl6 eval-perl5: add comments
  • Loading branch information
fglock committed May 26, 2012
1 parent 9ea3cc4 commit 1eb7e0c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions perl6-eval.p6
Expand Up @@ -22,6 +22,7 @@ eval($p5_str, :lang<perl5>);

=begin comments
If I define multi eval($str, :$lang! where 'perl5')
then rakudo can't find eval :lang<perl6> anymore
because eval is declared as an only sub
Expand All @@ -33,5 +34,18 @@ This is a workaround (by moritz++):
$str.eval;
}
Accessing perl6 variables inside eval (explained by moritz++):
sub f { say OUTER::.keys }; { my $x = 3; f() }
# $! GLOBALish $=pod EXPORT !UNIT_MARKER $?PACKAGE ::?PACKAGE $_ &f $/
sub f { say CALLER::.keys }; { my $x = 3; f() }
# call_sig $x $_ $*DISPATCHER
and you might need to walk the CALLER's OUTER
this one just gives you the immediate caller's scope
=end comments

0 comments on commit 1eb7e0c

Please sign in to comment.