On Thursday, January 30, 2003, 4:50:00 AM, Yukihiro wrote:

> The key is:

>   * no other way to make block local variables

> So that x in

>   a.each do |item|
>     x = ...
>   end
>   p x

> would not be a block local variable.  The code above will work without
> preceding "nil" assignment.


This makes it the same, scope-wise, as

  if cond
    x = ...
  end
  p x

The behaviour exhibited by that snippet always struck me as
"surprising", coming from C-like languages where "if" introduces a new
scope.

In general, I like scopes.

Gavin