Vector Identities, Redux and more questions



 

> -----Original Message-----
> From: maxima-bounces at math.utexas.edu 
> [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Neilen Marais
> Sent: Thursday, September 14, 2006 3:34 AM
> To: maxima at math.utexas.edu
> Subject: Re: [Maxima] Vector Identities, Redux and more questions
> 
> Hi, 
> 
> I'll write more later, but I have a burning question...
> 
> On Wed, 13 Sep 2006 12:05:02 -0600, Robert Dodier wrote:
> 
> > On 9/13/06, Neilen Marais <nmarais at sun.ac.za> wrote:
> > 
> >> 
> > matchdeclare (aa, scalarproduct2p);
> 
> How are multiple matchdeclares handled by maxima? Remember 
> that the "more_vect.mac" already does matchdeclare(aa, all). 
> Will this overide the previous declartion, thereby breaking 
> other rules made using aa, or do the rules store the 
> matchdeclares within themselves independent of redefinition later?

You could check this out by testing, but if you do
matchdeclare(aa, foopredicate),  then define a rule, and then change
foopredicate,
only the current definition of foopredicate is available, and that is used.

If you matchdeclare(aa, true), then I expect the rule compilation process
will
use that information and a subsequent matchdeclare(aa,foop) will not change
the meaning of the rule.

It would really be a bad programming practice to re-use the names in
matchdeclares
and change the associated predicates.

Could this be handled with lexical binding better? perhaps.
e.g.
block([aa,bb], matchdeclare(aa, ...),  defrule ....).

But much of what Maxima does gets hacked globally.  e.g. tellsimp(f(x)...)
changes
f globally.  deftaylor, too.  Only assignment to scalars is associated with
local variables.

RJF
> 
> > HTH
> > Robert Dodier
> 
> Thanks
> Neilen
> 
> --
> you know its kind of tragic
> we live in the new world
> but we've lost the magic
> -- Battery 9 (www.battery9.co.za)
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>