Skip to content

Instantly share code, notes, and snippets.

@skids
Created March 19, 2014 02:05
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 skids/9634210 to your computer and use it in GitHub Desktop.
Save skids/9634210 to your computer and use it in GitHub Desktop.
Perl6 role-local vars invisible through two layers of compilation, but not one
# grep . /tmp/f*.pm6
/tmp/f1.pm6:role A {
/tmp/f1.pm6: my @f = 1,2,3;
/tmp/f1.pm6: method f ( ) { @f.perl.say };
/tmp/f1.pm6:}
/tmp/f1.pm6:1;
/tmp/f2.pm6:use f1;
/tmp/f2.pm6:class C does A { }
/tmp/f2.pm6:1;
/tmp/f3.pm6:use f2;
/tmp/f3.pm6:C.new.f();
# ls /tmp/f*.pir
/tmp/f1.pir /tmp/f2.pir
# PERL6LIB="/tmp" perl6 /tmp/f3.pm6
Array.new()
# rm /tmp/f2.pir
# PERL6LIB="/tmp" perl6 /tmp/f3.pm6
Array.new(1, 2, 3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment