Change in semantics on multiple values

I noticed this here: http://www.rubygarden.org/ruby?Rite

a, b, c = x
# where x = [1,2,3]
# should they be:
# a=1,b=2,c=3
# or:
# a=[1,2,3],b=nil, c=nil

Matz still hasn’t decided, but it will be either:

Represent multiple values by subclass of Array, say Array::Values<Array
or
Separating arrays and multiple values strictly in syntax

What about the syntax:

a, b, c = *x

a=1,b=2,c=3

a, b, c = x

a=[1,2,3],b=nil,c=nil

or

a, b, c = *x

a=1,b=2,c=3

a, b, c = x

Raises an argument count mismatch type exception

They are what would make sense to me.

Greg McIntyre

Hi,

···

In message “Change in semantics on multiple values” on 04/03/30, Greg McIntyre puyo@optushome.com.au writes:

What about the syntax:

a, b, c = *x

a=1,b=2,c=3

a, b, c = x

a=[1,2,3],b=nil,c=nil

or

a, b, c = *x

a=1,b=2,c=3

a, b, c = x

Raises an argument count mismatch type exception

They are what would make sense to me.

The former.

						matz.