develooper Front page | perl.perl6.language | Postings from January 2004

Re: Semantics of vector operations

Thread Previous | Thread Next
From:
Luke Palmer
Date:
January 30, 2004 05:58
Subject:
Re: Semantics of vector operations
Message ID:
20040130135539.GA967@babylonia.flatirons.org
Luke Palmer writes:
> Scott Walters writes:
> > This would lend itself a P5 backport that did overload on its argument, too. If
> > it found that the thing on the right hand side was also overloaded into the
> > same class, it is could use a single iterator on both sides, otherwise it would
> > treat the 2nd argument as a scalar. This would solve the "single iterator
> > per line" problem for p5 atleast. It would work correctly. Any number of
> > vectorized arrays could be floating around in an expression, each interacting
> > with each other correctly.
> 
> Of course you mean "損interacting with束 other correctly." :-)

Grr!  That ruined that joke!  I'd better get this unicode thing figured
out before Perl 6 is released.

    »interacting with« other correctly.

Luke

> > Would it be possible to subclass things on the fly, returning a specialized
> > object representing the argument that knew how to vectorize when asked to add?
> > Aren't add, substract, multiply, and so on, implemented às class methods in
> > Perl 6, much like Perl 5's overload module?
> 
> No!  And I couldn't be happier!  They're multimethods, dispatching based
> on I<both> their arguments, not just the left one.
> 
> Luke

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About