I've implemented a fair amount of pdd21, mostly the invisible internals
part currently. Before I start with the final changes (and possibly
start breaking existing code), I'd like to summarize the planned
behavior.
Code snippet # NameSpace::name
.sub main # '' actually parrot [1]
store_global 'x', $P0 # parrot::x
cl = newclass 'Foo' # parrot::Foo
.end
.namespace ['Foo'] # 'Foo' but really parrot::Foo
.sub foo :method # Foo::foo actually
parrot::Foo::foo
store_global 'x', $P0 # Foo::x ... parrot::Foo::x
cl = newclass 'Bar' # Foo::Bar ... i.e. create nested
name
.end
.namespace ['Foo'; 'Bar'] # parrot::Foo::Bar
...
.HLL "perl5"," # new top-level namespace
.sub 'x' # perl5::x
...
The default HLL namespace is the pseudo-root namespace for all
namespace operations except 'get_namespace' and 'add_namespace', which
work from the actual namespace root.
The biggest change to the current implementqtion will be, that
'store_global' and 'find_global' will work relative to the *current*
namespace and not to namespace-root like now.
leo
[1] implicit HLL := 0, aka 'parrot' [2] default namespace
[2] the name migh change still