[EMAIL PROTECTED] (Jeremy Howard) writes:
> Brent Dax wrote:
> > Edwin Steiner:
> > # Could there also be *hypo*-operators, i.e. operators which try to
> > # *lower* (reduce) the dimensionality of their operands to the lowest
> > # common dim. So
[snip]
> > I don't really see the use of hypo-operators.
> >
> Well, it's pretty handy to be able to generalise what join() does for concat
> to any abitrary function. It's covered by:
> http://dev.perl.org/rfc/76.html
> which proposes a new reduce() builtin.
I'd like hypo-operators
a) for the sake of symmetry (imperfect symmetry that is)
b) because they minimize the separation of verb and object
cf. $acc += $_ for (@values);
vs. $acc +=^ @values;
(Well, that's not a hell of an argument, is it? :)
You could of course do more clever and confusing things
with multi-dim. arrays.
Anyway, I realize the need is less than urgent. :)
Maybe Perl 6 is going to be the language to resolve such
"I want it"/"I don't care"-arguments in a friendly way. It should be
feasible to write a module so you can do
{
use Operators::Hypo;
@score +=^ (4,1) *^ @points;
}
lexically, I mean.
What's needed is a parser hook for the operators (which is needed
anyway) and a way to write an extension module which provides
dynamically installable Perl ops which are (almost) as fast as the
builtins (which seems to be in planning).
-Edwin