Hi -- Minero Aoki <aamine / loveruby.net> writes: > [ruby-dev:23533] specifications of parameters and variables in Ruby 2.0 > > SASADA Koichi posted a summary of the latest specifications of method > parameters, block parameters and block variables that he heard from matz. > > [Local Variables] > > * Local variables are method-local. > * Block parameters are block-local. > * The name space of local variables and one of block parameters are > exclusive. e.g. > > i = 1 > iter {|i| # causes error > .... > } I thought the whole problem was that people wanted to be able to use the same names in blocks without a clash. The argument was always: what if you cut-and-paste a block from somewhere, or change a local variable name accidentally to the same as a block variable name? (My answer was always: there's no problem, so let's leave it the way it is now, but that isn't going to happen :-) > [Return Values and Parameter Passing] > > * `return a, b', `yield a, b' and `*array' makes a Values object. > > return 1, 2 --> Values(1,2) > yield 1, 2 --> Values(1,2) Does that mean: def m yield 1,2 end m {|*a| puts a.class } # "Values" ? It doesn't look like it, from the multiple assignment example below (a looks like an Array). But then I don't understand exactly what role is played by the Values object in the yield example. [...] > def yieldValues > yield 1,2 > end [...] > yieldValues {|a| } # error Does that mean that all method/block/lambda calling syntax is now unified? Meaning: they all will care equally about number of arguments? [...] > def m(a, b=nil, *rest, c:val, **krest) I have no convincing argument against this (I wish I did :-) except to note that we're getting into really heavy punctuation. I know that's not a very scientific observation... but I'm wondering how different Ruby 2.0 is going to look. Thanks for the summary! David -- David A. Black dblack / wobblini.net