On Jan 9, 2007, at 12:22 AM, Yukihiro Matsumoto wrote:

> Hi,
>
> In message "Re: [ ruby-Bugs-7680 ] a block argument within a block  
> which argument has the same name leaks"
>     on Tue, 9 Jan 2007 15:19:10 +0900, Evan Phoenix  
> <evan / fallingsnow.net> writes:
>
> |I agree they need work. Why not go back to the rubyconf 2005
> |proposal? I believe it was to allow new vars created in a block to be
> |normal local variables (not dvars).
>
> It's 2003.  I have not been confident about that idea even after three
> years of time.  Since blocks are closures, so they need to have their
> local variables in any way.  Can you imagine a function without local
> variables?

Of course methods need local variables, but blocks would have local  
variables still, just all in the scope of their defining method. Why  
do closures need to have their own, unique variables outside of the  
scope that they enclose? Smalltalk gets along quite well with all  
blocks sharing the same local variable scope. The current scope rules  
are a problem for a lot of new ruby programmers. Lots of them see the  
current behavior as a bug that they have to work around.

  - Evan

>
> 							matz.
>