Created
December 13, 2016 17:19
-
-
Save FCO/1561729d83b6737363ee871d90199184 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
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 | |
} | |
MacBook-Pro-de-Fernando:test fernando$ cat Use.pm6 | |
unit module Use; | |
use ToUse; | |
BEGIN { | |
ToUse.instance.getBla()<test> = 42; | |
} | |
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