GOTO Kentaro (gotoken / math.sci.hokudai.ac.jp) wrote:
: 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|  ...  }

The semicolon is a bit subtle.

I think it is too easy to fail to notice it.
(My eye just went right past it without noticing it.)

: 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.

Something more like the earlier suggestion of

K>> loop {|a, b, c, :d, :e|  ...  } 

wouldn't have this problem and would still be backwards compatible.

Just my 2 cents,

Cullen J O'Neill
--
cjon / engin.umich.edu