maps_over_lists or distribute_over



Am Dienstag, den 18.05.2010, 15:40 +0200 schrieb John Lapeyre:
> Is there a simple way for user to declare a user-function to have this property, or
> does it only work with 'simplifier functions' ?
> 
> For instance, if I write a maxima function inner_myfunc and then use:
> 
>   (setf (get '$myfunc 'distribute_over) '(mlist $matrix mequal))
> 
> and then
> 
>     matchdeclare (aa,all);
>     tellsimp (myfunc(aa),inner_myfunc(aa));
> 
> Then myfunc is first thread over lists and the result simplifies to inner_myfunc
> which then makes a function call.
> 
> I wonder if there is a more direct way to do this. Even if the above construction
> is necessary, you have added a very useful feature.
> 
> I guess the other route is to follow exampls of how double_factorial, etc are written.
> In this case the function is
> 
>   (defun $double_factorial (z)
>     (simplify (list '(%double_factorial) z)))

Thank you for your interest in this functionality of Maxima.

I have not added a user function to declare a user function to
distribute over bags. This might be a feature we should add to Maxima.
At this time, your approach is the best to do get this functionality for
a user function.

By the way the simplification distribute_over is done in the main
simplifier. The simplifier looks at the property list of a function to
check if the property distribute_over is present.

Dieter Kaiser