On Sat, May 07, 2005 at 01:00:08PM -0700, Larry Wall wrote:
: On the other hand, since we've distinguished hyperops on infixes from
: hyperops on unaries, maybe an infix hyperop in unary position just
: does the thing to itself:
: 
:     @squares = * @list;
: 
: which gives us a sum-of-squares that looks like this:
: 
:     @sumofsquares = [+] * @list;

On the gripping hand, I can't think of any other operators I'd be likely
to want to do that to, so forget it.  Not worth teaching people.  Let's
stick with

    @sumofsquares = [+] @list * @list;

I'm sure the optimizer can be smart enough to recognize that, if we need
to optimize it.  Should probably recognize

    @sumofsquares = [+] @list ** 2

as well.

Larry

Reply via email to