From: Mark Slagell Date: 2000-12-04T02:21:18+09:00 Subject: [ruby-talk:6778] Re: behavior of Proc#arity? Yukihiro Matsumoto wrote: > > Hi, > > In message "[ruby-talk:6746] Re: behavior of Proc#arity?" > on 00/12/03, Mark Slagell writes: > > |Note that POLS can't be entirely satisfied here: > | > | a,b,c = 1,2,3 # a=1; b=2; c=3 > | a,b = 1,2,3 # a=1; b=2 > | a = 1,2,3 # a=1 > | > |but, proc{|a| a}.call(1,2) returns an array. Would we want to > |distinguish a=1,2 from a=[1,2] ? > > What do you suppose the value of `a' after `a=1,2'? > I think it should be [1,2]. And my copy of miniruby works so now. > > matz. This illustrates how a Principle Of No Surprise language would be impossible, I guess... Yes I have to agree with you that [1,2] makes more sense, now that I've scratched my beard a little. A single variable on the left should get everything on the right; two or more on the left means special array assignment rules can take effect. The only way to be utterly consistent would be to assign 1 for 'a=1,2' and [1,2] for 'a=[1,2]', but I think lots of people wouldn't like that. Maybe I wouldn't like it either in the long run. :-) -- Mark