## []<sipb>(perl)jemorris>>> (02:08) Think of it as evolution in action
## perl needs vector operations like matlab has.
## my $sum = sum(@foo) and so on.
## []<sipb>(perl)eichin>>> (02:09) a little mouse, with gloves and a parka on, just waiting for the light to go out
## isn't
sub sum { my $s = 0; map { $s += $_; } @_; $s; }
## good enough?
## []<sipb>(perl)jemorris>>> (02:09) Eat Well, Stay Fit, Die Anyway
## yeah, but i want it to be there for me already!  :-)
## []<sipb>(perl)gsstark>>> (02:09) Gre.g
## should be easy to write an xs module to do those
## []<sipb>(perl)eichin>>> (02:14) Not even Maxwell Smart would be fooled. -- Bob Scheifler
## hmm, + isn't in the namespace, is it...
## I'm wondering if there's a way to construct  apply \+ @foo
## certainly
sub apply { my $opref = shift; my $s = shift; 
	       map { $s = &{$opref}($s,$_); } @_;
	       $s; }
## works for any normal two-arg sub...
## []<sipb>(perl)jemorris>>> (02:14) Put down the duckie and no one gets hurt.
## one could use the overload pragma, but i don't really want
## to make my numbers objects ;)
## []<sipb>(perl)jemorris>>> (02:16) the ability to quote is a serviceable substitute for wit
## you could write apply() with prototyping to take a block so that you
## could call
## $x = apply { $_[0] + $_[1] } @foo;
## i think
## []<sipb>(perl)eichin>>> (02:16) @b(Jane's Avionics)
## hmm, maybe you could use
sub make_oper { my $opname = shift; 
		return \{ eval "\$_[0] $opname \$_[1];" } }
## and then
## apply (make_oper "+"), @foo
## <sipb>(perl)<<< (err, add a trailing } to that... and maybe the eval
## quoting needs tweaking...
## []<sipb>(perl)eichin>>> (02:17) @b(Jane's NBC Protection Equipment)
## (err, add a trailing } to that... and maybe the eval
## quoting needs tweaking...
## []<sipb>(perl)jemorris>>> (02:17) Think of it as evolution in action
## yeah, that works :)
