self.c = 1
would conflict with:
def c
1
end
With a warning?
well, a warning might be good. the later definition would override the former
in such a case. at least that’s my initial thought on such an occurance. the
interesting thing though is that the distinction between the two cases above
becomes blured and could actually be represented in exactly the same manner
within the interpreter.
so
puts c
is
puts self.c # instance variable, not method
correct
Anyway, accessors are broken inside the class’ instance methods (and
sometimes we want them, when they do non-trivial things).
yes, this aspect would change the language a good bit, as instance variables
would not require accessors, and rather there visibility would be controlled
by public, private, and protected. just like methods. defining not simple
accessors would require name differentiation:
def complex_c
c ** -1
end
Ummm, now I realize that your idea corresponds exactly to defining
automagically accessors for each i.v. .
you got me
indeed it is quite close. in fact, i am really headed in a
direction where the distinction between methods and variables becomes mute.
Plus I think locals are more used than i.v. so it makes more sense to
prefix the latter…
the above is the reason why instance varaibles would loose the prefix.
I see, but this doesn’t change the fact that I’d have to prefix locals,
which are far more common.
that’s true. well, nothing’s perfect 
···
On Saturday 15 February 2003 02:21 am, Mauricio Fernández wrote:
–
tom sawyer, aka transami
transami@transami.net