Valery Pipin wrote:
> I see one problem with your definition in the first message.
> The infix operator assume at least two arguments.
As far as I know, "aa"([x]):=... means that "aa" takes variable number
of arguments (take notice of the &rest keyword in the lisp code).
> Then you should define another aa. If you want to take some algebraic
> simplification at the end you shoud also be more specific and make
> difference between symbol and number types arguments as well. So just
> "aa"(any,body):=block(
> if(symbolp(any) and symbolp(body)) then ......
Yes, that's exactly what I meant, "aa" should process its arguments and
return its' final form (in the infix notaion still). The difference so
far between maxima and lisp implementations is that maxima doesn't
return infix form of the operator. This is exactly what happens:
(C7) "aa"([x]):=(apply("aa",x));
(D7) "AA"([x]) := APPLY("aa", x)
(C8) a aa v;
(D8) aa(a, v)
(C9) :lisp $C8
(($AA) $a $v)
(C9) :lisp $D8
((&aa SIMP) $a $v)
(C9)
My final decision was to write in lisp, with success. Thanks for the
discussion, it helped, as well as prof. Fateman's precise explanations.
--
Andrei Zorine
p.s. declaring "aa" commutative frees from calling sort() (in my case at
leats)