"sum" quotes its arguments -- what's up with that?
Subject: "sum" quotes its arguments -- what's up with that?
From: Richard Fateman
Date: Tue, 07 Dec 2004 12:05:19 -0800
C Y wrote:
>--- Richard Fateman <fateman@cs.berkeley.edu> wrote:
>
>
>
>>I think that many of the problems, with integrate, sum etc.
>> would disappear if one insisted
>>on a notation that was better.
>>
>>For example, borrowing from lisp or scheme...
>>
>>instead of sum(i,i,1,3)
>>
>>we could have
>> sum ( lambda([i],i), 1..3).
>>
>>Thus it is clear where i is bound.
>>
>>
>
>Except then we will have a lot of new users who won't be able to
>understand why they have to type lambda while doing a summation.
>
In that case, you could tell people to write....
sum(f, i,1,3) and we would automatically translate it to
sum(lambda([i],f),1..3).
That's essentially what the sum program does now, except that if f is
a variable and not the
index of summation, it is evaluated once. I think that is what it does,
anyway.
Is it right all the time? no.
Is there another way to do it that is always right? I don't know of
one, though the
lambda idea helps.
>
>I think rather than trying to come up with a notational workaround we
>should put on our radar screen the sorting out of scope issues in
>Maxima. That seems like a perfect issue to tackle in 5.9.3
>development, since it will (hopefully) kill a lot of the reported bugs
>and unexpected behavior in things like this.
>
>CY
>
>
>
>__________________________________
>Do you Yahoo!?
>Yahoo! Mail - now with 250MB free storage. Learn more.
>http://info.mail.yahoo.com/mail_250
>
>