Mapping over "bags" by declaration; was Re: [Fwd: Re: "horner([...],x)/FIX" - ID: 631216.]



I just checked on the definition of meval1. It is a jungle, checking for 
things that simply do not and cannot exist in Maxima,
like lsubr  (left over from maclisp)

Nevertheless,
I think that it would be easy to call a function  (distributes-over 
operator argument)  at some key point, and map over the argument.
I wrote this for mapply1.  But mapply is not actually called from meval 
in general.  Possibly contributing to the meval mess :)

Note that if you say distribute foo over "[",  then foo( [a,b,c])  
evaluates to  [foo(a),foo(b),foo(c)]    {evaluated...}
But what would you like in case of foo( [a,b,c], d, [e,f,g])  ??

Code for mapply1 available on request.  (from file mlisp.lisp)


Richard Fateman wrote:
> Robert Dodier wrote:
>   
>> ..
>> I'm mostly in agreement, except I think it would be better
>> (for simplifying functions, anyway) to implement such mapping
>> via a declaration and a general mechanism in the simplification code,
>> instead of wedging (IF (MBAGP FOO) ...) into every function.
>>   
>>     
> Yes, but if you place it in meval or mapply,  it would work even in the 
> case of ratnumer etc.
>
> RJF
>
>
>
>
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>