In message "[ruby-talk:12289] Re: FEATURE REQUEST: 'my' local variables"
on 01/03/09, Yukihiro Matsumoto <matz / zetabits.com> writes:
>First, I will not introduce "my" as a keyword to Ruby.
>
>I'm thinking of something like
>
> loop {<a, b, c|d, e, f>
> ...
> }
>
>that declares block parameters a, b, c, and new local variables d, e,
>f, effective within the block, regardless of existence of outer
>variables of same names. Shadowing outer variables is allowed but you
>will be warned (it's bad habit anyway).
May I show yet another syntax?
loop {|a, b, c; d, e| ... }
This might have an advantage that the usual form can be seen as a
special case of this form. I have not considerd about possibility of
implementation, sorry.
-- Gotoken