From: "David A. Black" Date: 2005-05-22T07:00:13+09:00 Subject: Re: Multiple return and parallel assignement Hi -- On Sun, 22 May 2005, Martin DeMello wrote: > David A. Black wrote: >> >> It's hard, I find, to come up with an exact description of what the >> unarr?ay (unary unarray) operator does that fits every case. The >> closest I've come is: *a = x means: a gets assigned that which, when >> stripped of one level of array-ness, is x. Thus: > > And a simple rule of thumb to 'implement' it is: every time you remove a > * on one side of the =, add a [] to the other side. > > *a = 1,2 --> a = [1,2] > *a = *[1,2] --> [a] = [[1,2]] --> a = [1,2] Yes, though the illegality of [a] = x is what led me to phrase it in such a verbose way :-) However, using that formula: a = *[1,2] --> [a] = [1,2] --> a = 1,2 but a = 1,2 is the same as a = [1,2], which means that all of these are the same: a = 1,2 a = [1,2] a = *[1,2] which makes sense given the automatic array-wrapping of 1,2 but is worth noting since it looks kind of odd. David -- David A. Black dblack@wobblini.net