HaloO, John M. Dlugosz wrote:
I hope you have a few minutes to look it over.
I started to think it through. There are two quick remarks. In module M { class C { ... } class D { # lexical region where C refers to M::C method m1 () { my C $x; my Int $y; ... } class C { ... } # lexical region where C refers to D::C method m2 () { my C $x; ... } } } I would make the use of C in m1 of D an error because otherwise the scope D is split into two at the point where D::C is defined. In other words D::C is not the innermost definition everywhere in D. This is a serious source of subtle errors. If this is what you want than write M::C in m1. Scopes should be one-dimensional along the lines of inner versus outer. An additional dimension before versus after should be used only for error checking. That is in m1 C is parsed provisionally as M::C and this fails when D::C is seen later. Second, I don't like the concept of a virtual method that returns a type. That horribly mixes type level and value level. From the namespace POV we have M::D::foo and P::E::foo bound to the same implementation. In both cases C is OUTER::C. The "magic" should happen when an invocation of foo is created. That is the moment when the scope of OUTER::C can be bound by 'my C $b' through $x and $y respectively. Regards, TSa. -- "The unavoidable price of reliability is simplicity" -- C.A.R. Hoare