"horner([...],x)/FIX" - ID: 631216.



On 6/30/09, Dieter Kaiser <drdieterkaiser at web.de> wrote:

> With this changes $ratnumer and $ratdenom map over lists, matrices and
> equations. The function $horner will map over these bags too.

OK by me.

> I think it is useful to implement the mapping over lists and equations.
> This can be done at more places too.

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.

Specifically I would rather see this:

declare (foo, distributes_over ("["));
declare (foo, distributes_over (matrix));
declare (foo, distributes_over ("="));

and then detect that in the simplifier.

This scheme has 2 advantages: it's not necessary to change each
function, and it is easy to find the functions which map over
aggregates --- just look for the distributes_over property.

That won't work for ratnumer, ratdenom, & friends because they
are not simplifying functions. At the moment, I don't see a way
to handle them.

FWIW & all the best.

Robert Dodier