[ruby-talk:00354] Re: local variables

From: matz@... (Yukihiro Matsumoto)
Date: 1999-05-27 10:05:37 UTC
List: ruby-talk #354
In message "[ruby-talk:00353] Re: local variables"
    on 99/05/27, GOTO Kentaro <gotoken@math.sci.hokudai.ac.jp> writes:

|	BEGIN, top level, and def/class/module...end have new scopes apart
|	from outer scope.  Matz said this policy originated in CLU. 

I was believing so.  But recently I read the article about CLU again,
it found out I was wrong.  CLU's scope nests.  Now I'm wondering where
I got this idea from.  Hmm..

|	This result shows the fact that the first appearance of a variable 
|	spends more time cost.  But this result depends on the 
|	implementation of interpreter. 

That's not accurate.  In current implementation, access for the local
variables which appear for the first time in the block (they are
sometimes called as in-block local variables), slightly cost more than
ordinary local variables.  defined?(v) returns"local-variable(in-block)"
for these variables.

                                                matz.

In This Thread

Prev Next