Special Operators



On 1/3/11, Christian Wolf <ChristianLupus at gmx.de> wrote:

> 1. Is it possible to define a prefix operator with a parameter? E.g. M(A)
> f(x) should evaluate the operator M(A) on the argument f(x),
> where A is a parameter of M. Or have I to use infix operators (A M f(x))?

I think the Maxima parser is not powerful enough to handle M(A) f(x).
However, M(A)(f(x)) is acceptable to the parser -- is that good enough?

As it stands, an expression like M(A)(f(x)) is acceptable to the
parser and the simplifier, but not the evaluator.
I have a trivial patch to allow it (simply don't trigger an error).
I'll write more about it later.

Maxima allows expressions like M[A](f(x)). In this case M is a
so-called "memoizing" function, which remembers the value
calculated for M[A] the first time A is an argument.
I don't know if that's useful to you.

> 2. How is it possible to resurse operators? In the way (in prefix notation)
> M(A)^^2 f as M(A) M(A) f.

I think it can be done with simplification rules, although
I wonder how to use ^ or ^^ to represent repeated function
evaluation since those operators already represent something else.
(I would like to make it work that way, I just don't see how.)

best

Robert Dodier