Subject: Q about arguments scoping in function definition
From: Richard Fateman
Date: Tue, 9 Oct 2007 22:25:33 -0700
> -----Original Message-----
> From: Robert Dodier [mailto:robert.dodier at gmail.com]
> Sent: Tuesday, October 09, 2007 8:32 PM
> To: fateman at cs.berkeley.edu
> Cc: Stavros Macrakis; Andrey Siver; maxima at math.utexas.edu
> Subject: Re: [Maxima] Q about arguments scoping in function definition
>
> On 10/8/07, Richard Fateman <fateman at cs.berkeley.edu> wrote:
>
> > The current situation is pretty clear.
>
> Not at all. That's what led us to this discussion.
>
> > Use apply(f,[arg1,arg2, ...]) to be safe.
>
> How about if Maxima never evaluates a function name?
That would mean abandoning the "conventional mathematical notation" that
might be used in passing a function into a routine where it is bound to a
name f, and then calling f(x) internally.
It is, as noted, a dangerous idea to use this, and apply(f,...) should be
used instead. Nevertheless, some people place a high value in the
naturalness, mathematically speaking, of the notation.
I could argue either way on this.
The use of arrays in maxima is probably inherited from the use of arrays in
maclisp, which was hard to understand. The meaning of a[k] as a memoized
hash array vs ordinary array is already confusing to people...
RJF
> (An idea raised elsewhere in this thread.)
> I would be willing to consider that. Never evaluating
> function names is easy to explain.
>
> It appears that Maxima never evaluates array names.
> Since arrays are just functions on finite domains, in the
> interests of consistency Maxima should apply the same
> policy to a[k] and a(k). I wouldn't mind changing function
> evaluation to match array evaluation.
>
> Robert
>