On Fri, 1 Nov 2002, Ed Peschko wrote:

>       @a ^[+]= @b;

compared to

> @a ^+= @b;
>
> ie: they are exactly the same.

You are right, you get the same answer whether you do the hyper or the
assignment first, except in the "scalar ^op= list", in which case doing
the assignment last gets you the length of the list or some other useless
result.

> I'd say that '=' has *implicit* vectorization
> here in the array case. In the scalar case:

Right.  ^= is rather pointless, because = already understands list
context.

OTOH, you can get some different effects out of ^= by virtue of the
"dimensionally replicate, quantitatively undef-extend" rule for vectoring
operators.

   @a ^= @b  #  @a.length == max( @a.length, @b.length )
   @a ^= $b  #  all currently existing elements of @a are set to $b
   $b ^= @a  #  Yuck!  $b = last element of @a.

~ John Williams


Reply via email to