On Saturday 01 February 2003 04:43 am, Brian Candler wrote:

> [1,2,3].each do |foo|
>   myvar = foo
> end
>
> myvar and puts myvar

> The proposed new behaviour is that myvar persists beyond the loop, whereas
> now it doesn't (if it didn't exist before the loop). I can't see how that
> would break things. You would have to write pretty obscure code for it to
> work where 'myvar' does not exist, but break if 'myvar' does exist :-)

and foo? that would remain local to the block, but not myvar?

> FWIW, I think the proposed solution looks like one of those "doh! why-
> didn't-we-think-of-it before" ones. At least, anything to avoid the
> nightmare of two different assignment operators with different semantics!!

yuk, agreed.

> But having said that, I know I don't understand the scope rules anyway,
> because

i still would like to hear another's opinion on scope being defined by the 
current value of self. (guess no one read my other message on this) dosen't 
it seem reasonable that they'd be coorelated?

-- 
tom sawyer, aka transami
transami / transami.net