From: Kristof Bastiaensen Date: 2004-04-27T08:54:08+09:00 Subject: Re: Semantics of Multiple Values Hi, this looks very interesting. I particulary like the hash passing mechanism. I will add it to my RCR. It would then work also inside method definitions: def params({:this => a, :that => b}) [a, b] end params( {:this => 1, :that => 2, :dummy => 3} ) => [1, 2] Maybe it would be too hard to implement, or decrease performance, but that is not for me to decide! > Examples of possible rules: > > {:a=>a, :b=>b} = f(x) > # provided f(x) returns hash, h > # h[:a] and h[:b] assigned to a, b > > y.a = f(x) > # provided f(x) returns object x with accessor a > # assign x.a to y.a > This wouldn't work, because y.a = f(x) is already valid syntax, meaning call y.a= with the value of f(x) > y.a, y.b = f(x) > # provided f(x) returns object x with accessors a, b > # assign x.a, x,b to y.a, y.b > Neither does this, because it would mean pass the multiple values from f(x) to the methods y.a= and y.b=