On Tue, Sep 19, 2000 at 08:07:33AM -0700, Dave Storrs wrote:
> On Tue, 19 Sep 2000, Nathan Wiger wrote:
> > And then there's the lexical variable issue too:
> > 
> >    The default variable scope rules for Ruby (default: local) are
> >    much better suited for medium-to-large scale programming tasks;
> >    no "my, my, my" proliferation is needed for safe Ruby programming
> 
>       Actually, this is the bit that interests me.  Most times, when you
> create a variable, you *do* want local scope.  

Really?  You want a brand new $foo inside a while loop, distinct
from the one inside the surrounding sub?  That is lost when the while
loop terminates?

> I think I would be
> guardedly in favor of changing the default scope from global to local
> (although I have the feeling there is something I'm not considering). What
> does everyone else think?

Sounds like a really bad idea.  That's one of the reasons why people
tend to hate tcl: everything is 'upvar' this and 'upvar' that to go
up one level of scope.

Z.

Reply via email to