Larry wrote:

In theory I suppose you could have objects with module attributes:

    class Foo {
        has module .Bar { ... }
    }

Just don't ask me what it means...

Of course, Larry's just joking there...he knows precisely what it means.


It means that every object of class Foo has its own private version of
the .Bar module which in turn has its own private namespace. So that, for example, any reference to a package variable of that module:


        method Foo::baz {
                $.Bar::qux++;
        }

refers to the $qux variable belonging to the .Bar module belonging to the Foo object on which the &baz method was invoked.

This kind of behaviour is more useful for nested classes, I suspect, but
it should certainly be available for nested modules as well.

Damian



Reply via email to