Larry,
On Sep 8, 2005, at 5:07 PM, Larry Wall wrote:
On Thu, Sep 08, 2005 at 04:52:52PM -0400, Stevan Little wrote:
: But what if I want to do this?
:
: class Foo {
: my %:stuff;
: method keys (Class $c:) {
: %:stuff.keys();
: }
: }
:
: How can I get at my namespace now? How would I disambiguiate that
call?
: Doing something like Foo.Package::keys() seems to me to be exposing
too
: much of the meta-level (the Package class).
:
: I can see lots of potential conflict between class methods and
methods
: to access the contents of a namespace (methods defined in the Hash
role
: I assume). This means that Foo is getting even more and more magical.
: It's now a type annotation, a special undef value, the invocant in
: class methods and the "gatekeeper" of the namespace.
Well, like I said, we can require the extra :: in cases of ambiguity.
It's
really only the misplaced sigil I'm trying to get rid of.
So it would be Foo::.keys() then?
Would this be possible?
my $pkg = Foo::;
# or maybe this ...
my $pkg = Foo<::>;
Would $pkg be an instance of the Package class? I would assume given
this code:
package Foo {
...
package Foo::Bar {
...
}
}
I can do this:
my $pkg = Foo::{'::Bar'}
And get back some kind of Package reference of some kind.
Do we even have first class packages?
hmmmm....
Stevan