For example, if I have the following files:
Foo.pm
module Foo-0.0.1;
use v6;
# note the lack of 'is export'...
sub bar {
say "Foo::bar";
}
foo.p6
use v6;
use Foo;
bar();
I'd assume this should be an error, since bar isn't exported, but it's
not, running the code prints out "Foo::bar". This is even the case if I
define another 'sub bar' in foo.p6, the version from Foo.pm is still called.
Am I missunderstanding this, or is it a bug?
-garrett
On May 1, 2005, at 5:44 PM, Garrett Rooney wrote:
> I might have this wrong, but isn't the 'is export' trait on a
> subroutine supposed to indicate that it's exported into the namespace
> of the code that uses or requires the module? That doesn't seem to be
> happening right now. Well, it is happening, but it's also happening
> for subroutines without that trait, and that seems wrong.
>
> I'd assume this should be an error, since bar isn't exported, but it's
> not, running the code prints out "Foo::bar". This is even the case if
> I define another 'sub bar' in foo.p6, the version from Foo.pm is still
> called.
>
> Am I missunderstanding this, or is it a bug?
Currently 'is export' is a placeholder (which means it parses ok, but
does nothing). Packages/Modules are still unfinished in Pugs.
Stevan