From: "David A. Black" Date: 2003-12-06T20:44:11+09:00 Subject: Re: Attempted roadmap of future instance variables.... Hi -- On Sat, 6 Dec 2003, Daniel Berger wrote: > Hi all, > > I thought I'd weigh in here. Instead of relying on > per-variable syntax, what about a keyword? Here is > some fictional syntax. > > class A > def foo > # regular instance variables > @var = "hi" > > # anything below 'local' here is a > # class-local instance variable > local: > var = "hello" > end > > def bar > puts @var # 'hi' > puts class.var # 'hello' > end > end > > Just an idea. Thoughts? I'm not sure where "class.var" comes from... var is an instance variable of A objects, it looks like, not of A (unless you meant that local: clause to come after the method definition?) and in any case you haven't defined a method called 'var', just a variable. Also, how would you differentiate between the instance variable var and a local variable (or method) called var? (Mind you, my basic feeling about 'local' is that I would dislike it :-) Nonetheless I'm curious how you would see it playing out.) David -- David A. Black dblack@wobblini.net