|
From: Raymond T. <toy...@gm...> - 2026-01-09 17:59:01
|
On 1/9/26 9:40 AM, Stavros Macrakis wrote: > On Thu, Jan 8, 2026 at 6:56 PM Robert Dodier <rob...@gm...> > wrote: > > On Thu, Jan 8, 2026 at 3:18 PM Stavros Macrakis > <mac...@gm...> wrote: > > > As Fateman points out, no common programming languages support > subscripted formal variables, for all the good reasons you give. > > That's a pretty weak argument, isn't it? There's already all kinds of > stuff in Maxima that doesn't exist in other languages; that's kind of > the point of having different languages. > > > You gave the reasons in your mail. Some more examples: > > Does *i:3$ f(x[i]):=...* define *f(x[i])* or *f(x[3])*? I don't think > it can define *f(x[3])*, because then how would the body of the > definition "know" the value of *i *at the time it is called? Even if > we had lexical scope, what would *block([i], i:3,* *f(x[i]):=..., i:4, > f(x[i]), ...) *do? > > Does *f(x[i]):=block([i:3], x[i])* return the value of the formal > *x[i]*? Or *x[3]*? > > What does *f(x[2]):=sum(x[i],i,1,3) *return? > > etc. Basically, it complicates the semantics for no purpose that has > been articulated yet. I didn't study all of the various proposals, but I would prefer simple things instead of clever things because I'm not clever enough to remember them all. But I also don't do all that much programming in the Maxima language. ​ |