# [Maxima] Vector Identities, Redux and more questions

Neilen Marais nmarais
Thu Sep 14 09:43:50 CDT 2006

```On Thu, 14 Sep 2006 08:04:31 -0600, Robert Dodier wrote:

> On 9/14/06, Neilen Marais <nmarais at sun.ac.za> wrote:
>
> When a rule is defined, the matchdeclare predicates for the symbols
> appearing in the rule are pasted into a Lisp function which implements
> the rule. If matchdeclare is called again, it has no effect on existing
> rules.

Would the best plan not then be to immediately remove the matchdeclare
property?  I.e.

matchdelcare(xx,foop)\$
/* rules stuff involving xx */
remove(xx, matchdeclare)\$

The rationale being that we want to be minimally intrusive, i.e. not
clutter the standard environment. Well, actually even better might be
to save and restore the matchdeclare property.

OTOH, if Richard's block() idea can work that's probably not a bad idea
either. A cursory glance reveals that

block([xx], local(xx), matchdeclare(xx, nonscalarp), defrule(foorule,
xx^2, xx.xx));

ought to work:

(%i16) printprops(xx, matchdeclare);
(%o16) [scalar_not1p(xx)]

(%i17) block([xx], local(xx), matchdeclare(xx, nonscalarp),
defrule(foorule, xx^2, xx.xx));
(%o17) foorule:xx^2->xx.xx

(%i18) printprops(xx, matchdeclare);
(%o18) [scalar_not1p(xx)]

(%i19) declare(a, nonscalar);
(%o19) done

(%i20) apply1(a^2, foorule);
(%o20) a.a

My only worry is that if we start having globally defined matchdeclare
properties we should probably define all the matchdeclare variables right
at the start of vect, also some naming convention is also called for.

Thoughts?

Regards
Neilen

> HTH
> 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)

```