Created
April 29, 2016 15:23
-
-
Save anonymous/35b0e607f4268c5a25e2eab0513a0112 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
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!' | |
} |
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 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