From: Jesse Tov Date: 2003-12-07T16:32:03+09:00 Subject: Re: Attempted roadmap of future instance variables.... Dan Doel : > The only thing I can see being a problem is if a class's mix-in 'parent' > needs to share a variable with a class's class-inheritance parent. It > would be awkward for them to have to know about each other > since that limits code generality. Hm. I'm not sure, but it may not have to be a problem. If @::a refers to @a in the class-inheritance parent, then it can mean the same thing from a mixin that is mixed-in at the same level. The mixin parent clearly needs to know that the class parent exists, even if it doesn't know what it is; the class parent doesn't need to know about the mixin parent. So if they need to share something, the mixin should go ahead and use the class parent's instance variable. I'm having a hard time making clear what I mean, so consider this. If you have: module M class A class B < A include M then @::a used in M refers to A's @a, since A is the class-parent at the level where B is included. I'm not sure what happens if we add: class C < B include M There's also the possibility of defining a light syntax such as @:: as sugar for a heavier namespace syntax. There might be trickier things that could only be done with the heavier syntax, but the light syntax would work most of the time. > This might not be a problem that realistically arises, though. I'm not > really sure. "No one will ever need that" are famous first words. Jesse