-
-
Save ugexe/a9463c3ec6a1ae257ed2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use MONKEY-TYPING; | |
augment class IO::Path { | |
method blah { say "..." } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nickl@localhost:~/perl6/zef$ perl6 test.pl6 | |
CompUnit.new(from => "Perl6", name => "mod", extension => "pm6", precomp-ext => "moarvm", path => q|/home/nickl/perl6/zef/mod.pm6|.IO(:SPEC(IO::Spec::Unix)), has-source => Bool::True, has-precomp => Bool::False, is-loaded => Bool::False) | |
------- | |
True | |
CompUnit.new(from => "Perl6", name => "mod", extension => "pm6", precomp-ext => "moarvm", path => q|/home/nickl/perl6/zef/mod.pm6|.IO(:SPEC(IO::Spec::Unix)), has-source => Bool::True, has-precomp => Bool::False, is-loaded => Bool::False) | |
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use lib '.'; | |
use mod; | |
class CompUnit2 is CompUnit { | |
has $!path; | |
has $!has-precomp; | |
has $.precomp-path; | |
has $.build-output is rw; | |
method precomp($out, |c) { | |
$!precomp-path = $out //= self.precomp-path // "{$!path}.{$*VM.precomp-ext}"; | |
nextwith($!precomp-path, |c) | |
} | |
} | |
my $in = "mod.pm6"; | |
my $out = "mod.pm6.moarvm"; | |
my $cu = CompUnit2.new($in.IO.absolute); | |
say $cu.perl; | |
say "-------"; | |
say $cu.precomp($out); | |
say $cu.perl; | |
say "----"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment