At 15:15 -0400 4/21/04, Dan Sugalski wrote:
>At 10:24 AM -0700 4/21/04, Jeff Clites wrote:
>>then there wouldn't be any temptation to think of >>+<< as a separate operator.
>
>I think... that'd be bad, generally speaking. (And not just because the math folks 
>have tensors and know what to do with 'em) It's a separate set of operations and, 
>while there are *default* behaviors, there's reason to override those defaults while 
>not touching other things.

It's nice to see that they are no longer "vector" operators. Thanks Larry.

But >>+<< really is a vector sum in the mathematical sense. It's  >>*<< that I would 
really like to override some day so that, with a scalar result expected, it will 
return the sum of the products taken component wise - the dot product.

$dotproduct = @myclassvectorA >>*<< @myclassvectorB;

It could also return a cross product (not just a component-wise product)  in a list 
context.

@myclassvectorX = @myclassvectorA >>*<< @myclassvectorB;

Multiplying a vector by a scalar should do just what the hyper-op does.

@mylongervector = $scalefactor  >>*<< @myclassvectorA;

I understand that it's not practical extraction and report generation and 
understandably shouldn't be built into perl 6, but the individual override capability 
seems important to me.

-- 
-->  There are 10 kinds of people:  those who understand binary, and those who don't 
<--

Reply via email to