On Wed, Dec 10, 2003 at 01:37:22AM -0700, Luke Palmer wrote:
> 
> I think a heirarchy is a good idea for namespacing in general.  I've
> always wanted to be able to tie namespaces in Perl 5.  It would only
> make sense that if I tie Foo::, that Foo::anything:: would also go
> through that tie to get the anything:: stash.

That's a good point.

Another related one include any perl code that
manipulates/introspects/iterates over a package.

Package aliasing (something like *{"Bar::"} = \*{"Foo::"}) might
not work well in Perl 5 but I think Perl 6 is meant to be able to
do things along those lines.

But there may be some misunderstanding here (perhaps just on my part :)
Given

        package Foo::Bar::Baz;
        $var = 1;

In perl5 the var variable is stored something like this (excuse the
probably imprecise syntax, but you'll get the idea):

        *{"Foo::"}->{"Bar::"}->{"Baz::"}->{var};

For parrot I'm not sure if Dan was proposing

        *{"Foo\0Bar\0Baz"}->{var};
or
        *{"Foo\0Bar\0Baz\0var"};

The first just flattens the package name but keeps the contents of
the package as distinct elements within the package 'object'.
The second flattens both the package name and the name of the item
within the package into a single key.

I think Dan was proposing the first and that's fine.
I think the second would be a mistake.

Tim.

Reply via email to