Robert Dodier wrote:
>
> I'm pretty sure it would be simpler and clearer if we would
> get rid of the special evaluation scheme.
>
The "fix" that makes most sense to me is to change the first argument to
a functional form, which also removes
the need for an index variable.
that is,
sum(i^2,i,1,n) ;; old form
sum( lambda([i],i^2), [1,n]). ;; suggested new, alternative
This kind of thing is used (inconsistently) in Mathematica, where
RootSum uses a functional form, but other
programs like Sum and Minimize do not. For Rootsum e.g. you will see
something like #1^5+11#1+1 & instead of x^5+11*x+1.
That first form is like lambda([#1], #1^5+11*#1+1) in Maxima.
It is possible to automatically convert from old to new form, and even
use both of them.
The question mostly is if you want to evaluate the summand 0, or 1 time
before lambda-wrapping.
This is the same question you face now that I think is troublesome.
Be assured that the solution you (Robert) propose (making the summand
evaluated normally) was tried first and
found inadequate. But maybe expectations change.
RJF