Jeff Clites writes:
> On Sep 7, 2004, at 6:26 AM, Dan Sugalski wrote:
>
> >*) Namespaces are hierarchical
> >
> >So we can have ["foo"; "bar"; "baz"] for a namespace. Woo hoo and all
> >that. It'd map to the equivalent perl namespace of foo::bar::baz.
>
> How does this hierarchical nature manifest? I ask because I don't know
> of any languages which actually have nested namespaces,
Other than, um, well, Perl.
> so I'm not sure what this is meant to imply. In particular, if this
> implies cascading lookup (meaning that a symbol looked up in ["foo";
> "bar"; "baz"] would fall back to looking in ["foo"; "bar"] if it
> didn't find it), than that's not how Perl5 packages work.
No, the lookup is not cascading downwards. It is cascading upwards,
however, so that in:
[ "foo"; "bar"; "baz" ]
The [ "foo"; "bar" ] part can be implemented differently. This means
that Python's namespaces and Perl's namespaces can have different
semantics. Picture a PythonStash and PerlStash pmc.
Luke