From: "Matthias Wächter" Date: 2011-12-09T17:31:31+09:00 Subject: [ruby-core:41561] Re: [ruby-trunk - Bug #5730][Open] Optinal block parameters assigns wrong Hi Matz, Please excuse my ignorance, but why do we want this auto-splat behavior in Ruby at all? For me this goes very much against the POLS. Has this been discussed or documented somewhere for reference? As a programmer, I would assume that when I send a message, e.g. via block.call() which does support multiple arguments, each of these arguments would be assigned to the block parameters in order, irrespective of each argument�s type/class. Why should arrays play differently at all? If I want to splat at the sender side, I can simply do that at will � it�s just one asterisk. If I want to splat at the receiver, I can do as well. Things get worse as soon as the argument is an object returned from deep inside the code, where I�m not sure about its type. If it�s some type other than array, the code does what I expect. If it�s an array, a magical splat happens. What I�d like to have is a much more consistent view of assignments with less exceptions�. # my expectation a,b=[1,2] # => a=[1,2], b=nil a,b=*[1,2] # => a=1, b=2 (a,b)=[1,2] # => a=1, b=2 a,b=1,2 # => a=1, b=2 a=1,2,3 # => a=1 *a=1,2,3 # => a=[1,2,3] *a=[1,2,3] # => a=[[1,2,3]] The only exception I�d like to see in the specs is that applying a splat on something that is un-splattable results in the object itself. All other exceptions and automatisms should go away. � Matthias [1]: I think I�m going to write a book called �Ruby by Exceptions� that covers all those "[�] , but [�]" cases and unexpected automatisms in Ruby specification that go against my understanding of POLS.