From: Carlos Date: 2002-06-12T07:37:54+09:00 Subject: Re: ruby-dev summary 17252-17356 > a = 1 > i = 2 > (1..10).each do |i;a| > a = i*i > end > > p a #=> 1 > p i #=> 10 > > and I assume > > a = 1 > i = 2 > (1..10).each do > a = i*i > end > > p a #=> 1 > p i #=> 2 and 5.times do |;a| a=gets; print a end or 5.times do <;a> a=gets; print a end ? Both are very ugly ;) I think parameter passing and locality (?) of variables should be handled orthogonally. Maybe adding a new keyword. I can think (uh... these are very ugly too): - extending the block syntax to optionally predeclare local variables: (1..10).each usinglocals :a, :i do |i| a=i*i end - adding a keyword to declare a local variable: (1..10).each do |my i| my a; a=i*i end - the same, but postdeclaring (?) the parameters as local: (1..10).each do |i| my i, a; a=i*i; end I'd prefer a little more verbosity than more special symbols and dangling semicolons and commas...