From: Christoph (news_chr) Date: 2003-12-07T21:42:18+09:00 Subject: Re: Attempted roadmap of future instance variables.... Jesse Tov wrote .... > 2. A > It doesn't add anything new, since :: already exists for similar things. > It's lightweight and non-restrictive, and seems to blend into the > language pretty well to me. Here's an example: > > class A > def a=(x) > @foo = x > end > end > > class B < A > def b=(x) > @foo = x > end > end > > class C < B > def c=(x) > @foo = x > end > > def c; > @foo > end > > def b; > @::foo # could also be @B::foo > end > > def a > @A::foo > end > end > > c = C.new > c.a = 1 > c.b = 2 > c.c = 3 > > puts(c.a, c.b, c.c) ==> 1, 2, 3 If we go that route we might as well introduce this (possibly instead) for methods too (there was some demand for this kind appility in connection with mixins) class A def foo p "A" end end class B