On 5/3/10 1:24 AM, Robert Dodier wrote:
> On 5/2/10, Raymond Toy <toy.raymond at gmail.com> wrote:
>
>
>> This seems like a bug in lsum:
>>
>> gg : x^3+t*x^2-3*x-2*t$
>> lsum(gg*t,t,rootsof(t^2+1));
>> ->
>> ?%lsum(gg*t,t,rootsof(t^2+1))$
>>
>> Shouldn't gg be substituted? How can I do this?
>>
> Well, lsum quotes its arguments; I guess the intent is to
> evaluate t only when the list values are known. Seems reasonable.
> A side effect is that nothing else in the first argument gets
> evaluated either. When the list values are unknown,
> should lsum do something like (let (($t '$t)) (meval expr)) ??
> I guess I'm against it -- clever evaluation seems to cause more
> trouble than it's worth; sum being the major example.
>
Ok, I guess. Somehow I was expecting the arguments to be evaluated
before the function is called, like other programming languages. But
that's not a very good reason.
> Maybe apply(lsum, [gg*t, t, whatever]) has the effect you want.
>
>
That does what I want.
>> (The 1D display of lsum needs work too.)
>>
> I guess this is missing:
>
> (setf (get '%lsum 'noun) '$lsum)
>
> and for good measure we can include
>
> (setf (get '$lsum 'verb) '%lsum)
>
>
I can apply that soon.
Ray