[Maxima] function definition
robert.dodier at gmail.com
Wed Jan 31 09:57:04 CST 2007
On 1/31/07, sen1 at math.msu.edu <sen1 at math.msu.edu> wrote:
> Why did I have to do 'kill(f)' to get S(.,x) to operate on g ?
If I'm not mistaken, it's because Maxima is neither a Lisp-1 nor a Lisp-2.
Apologies in advance if I have the terminology backwards or something.
Lisp-1 => when f has a value, f(x) = <something>(x) always
Lisp-2 => when f has a value, f(x) = <something>(x) never
Maxima doesn't follow either policy; instead Maxima's policy is:
when f has a value, f(x) = <something>(x) only if f does not name
a function; if f names a function, then f(x) => call function f
even if f has a value.
In the problem at hand, instead of f(x) one could write apply(f, [x])
and maybe that would yield the expected behavior.
Although that's an obscure workaround.
A consistent Lisp-1 policy, or lexical scope, would yield the
expected behavior here. I'm not advocating either one of those
More information about the Maxima