Do not redefine . in vect.mac, was: Vector ops and non-commutative matrix mult revisited
Subject: Do not redefine . in vect.mac, was: Vector ops and non-commutative matrix mult revisited
From: Neilen Marais
Date: Wed, 06 Sep 2006 17:46:48 +0200
Robert,
On Wed, 06 Sep 2006 08:55:24 -0600, Robert Dodier wrote:
> On 9/6/06, Neilen Marais <nmarais at sun.ac.za> wrote:
>
> A different approach is to modify share/vector/vect.mac so that it
> does not redefine . to be commutative, which is bad style to begin with.
> vect.mac seems to want . to mean the scalar product of vectors
> (a.k.a. the dot product) which is common enough outside of Maxima,
> but requires changing the built-in properties of . which leads to an
> unpleasant surprise (as you know).
>
> vect.mac should probably define a new operator (let's say "dot")
> instead of redefining "." . Of course that will cause a problem for
> anyone who loads vect and expects . to be redefined.
> On the balance, though, I am inclined to fix it now (and accept
> the backward incompatibility) rather than revisit this gotcha.
> I've bumped into it before myself.
>
> Yet another approach to redefine . only within the vect package.
> That would require a working package or namespace scheme,
> which we don't have at the moment.
>
> Comments?
Namespaces would IMHO be the best solution, but is obviously not something
that's going to happen overnight? Anyway, making a backwards-incompatible
change to vect.mac seems to me to be the lesser of available short-term
evils, since at this time the number of people heavily invested in
"legacy" Maxima mode is probably rather small.
Regards
Neilen
>
> Robert Dodier
--
you know its kind of tragic
we live in the new world
but we've lost the magic
-- Battery 9 (www.battery9.co.za)