Brian Candler <B.Candler / pobox.com> wrote:
 Furthermore, consider cases like this:
> 
>    if ... some condition
>       ...
>       flag = true
>    end
> 
>    flag && do_something
> 
> In the current model, 'flag' is always available at the final statement, as
> a known local variable, with value 'nil' if not assigned. If it were
> dynamically created, then the final statement might crash altogether. If
> there were any chance of this happening, you would have to add 'flag=nil' at
> the top of the code, effectively a declaration of the variable.

I don't think the proposed change alters this behaviour at all. 

Consider this too:

def condn(test)
  yield if test
end

condn(test) {
  ...
  flag = true
}

p flag # => undefined local variable or method (NameError)

Whereas with the proposed modification blocks would behave more like
built-in constructs like 'if' and 'case'.

martin
> You could of course resolve this by making local variables have a distinct
> syntax from method calls - say $variable. Oops, we wouldn't want that :-)
> 
> Cheers,
> 
> Brian.
>