Skip to content

Instantly share code, notes, and snippets.

@FCO
Created December 14, 2016 01:42
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 FCO/8bb0f2459b294af3930ea0731e71f10e to your computer and use it in GitHub Desktop.
Save FCO/8bb0f2459b294af3930ea0731e71f10e to your computer and use it in GitHub Desktop.
MacBook-Pro-de-Fernando:test fernando$ cat ToUse.pm6
unit class ToUse;
has %!bla;
my $instance = ::?CLASS.bless;
method new {!!!}
method instance {
$instance
}
method getBla is export {
%!bla
}
multi trait_mod:<is>(Routine $r, :$fuzzed!) is export {
ToUse.instance.getBla(){$r.name} = True;
}
MacBook-Pro-de-Fernando:test fernando$ cat Use.pm6
unit module Use;
use ToUse;
sub bla() is fuzzed {}
MacBook-Pro-de-Fernando:test fernando$ cat main.p6
use Use;
use ToUse;
say ToUse.instance.getBla
MacBook-Pro-de-Fernando:test fernando$ perl6 -I. main.p6
{}
MacBook-Pro-de-Fernando:test fernando$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment