Skip to content

Instantly share code, notes, and snippets.

Created April 29, 2016 15:23
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 anonymous/35b0e607f4268c5a25e2eab0513a0112 to your computer and use it in GitHub Desktop.
Save anonymous/35b0e607f4268c5a25e2eab0513a0112 to your computer and use it in GitHub Desktop.
unit module m1;
our class TestClass is export {
method foo() {
say 'M1 TestClass foo is called'
}
};
our sub foo() is export {
say 'M1 foo is called!'
}
#use m1;
require './m1.pm6';# <TestClass>;
m1::foo(); # both of "use m1;" and "require ..." works.
#foo();
my $tc = m1::TestClass.new(); # only "use m1" works, "require ..." gives error of no symbol of TestClass.
$tc.foo();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment