At 04:06 PM 8/9/00 +0000, Ed Mills wrote:
>In keeping with Larry's design philosophy that the language should "not
>just sit there -do something!" I agree that there should be a number of
>vector/matrix manipulations available, performed in a psuedo-scalar
>context (not in a loop).
That would be list context. (Or perhaps array or hash context, and yes I
know we don't have those right now)
> Just to name a few:
[Snip]
>etc. etc. This kind of functionality would attract a whole new category of
>users from mathematics and other areas, as well as giving us optimized
>solutions to operations that many of us do regularly in loop contexts.
I expect it would make other things interesting as well, not just math
things. (Running a substitution on an array would be keen, for example)
>On the other hand one can argue all of these belong in CPAN under a
>matrix:: library or something like that, but to me if would make Perl a
>powertool to build these kinds of functions into the language syntax. In
>many cases these can be treated as overloading scalar ops for a non-scalar
>context.
While I'm firmly of the opinion the code to actually Do Something should be
elsewhere (at least to start), support definitely needs to be in the core
to notice what that something is--you won't get very far with:
@a * @b
if perl does a scalar on both arrays before doing the multiplication...
Dan
--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
[EMAIL PROTECTED] have teddy bears and even
teddy bears get drunk