[#1816] Ruby 1.5.3 under Tru64 (Alpha)? — Clemens Hintze <clemens.hintze@...>

Hi all,

17 messages 2000/03/14

[#1989] English Ruby/Gtk Tutorial? — schneik@...

18 messages 2000/03/17

[#2241] setter() for local variables — ts <decoux@...>

18 messages 2000/03/29

[ruby-talk:02317] Re: Question about attribute writers

From: Dave Thomas <Dave@...>
Date: 2000-03-31 23:25:03 UTC
List: ruby-talk #2317
Clemens Hintze <c.hintze@gmx.net> writes:

> At least I would expect it! It is like answered in your FAQ! How does
> Ruby determine what a variable is? It is really stright-forward, IMHO.
> 
>    Look if there was an assignment before
>       yes => compile a variable access
>       no  => compile a method call.

True - I asked the wrong question. Rather than asking "is this the
expected behavior", I guess I meant "is this the behavior that someone 
would expect?" It seems to violate the principle of least surprise.

Perhaps a warning would a good idea in these circumstances:

  warning: local variable eclipses instance method

Dave


-- 
Thomas Consulting.
Innovative and successful developments with Unix, Java, C, and C++. 

Now in bookstores:
 The Pragmatic Programmer.  www.pragmaticprogrammer.com/ppbook/

In This Thread