Re: [Maxima] problem calling MAXIMA function at lisp level
Subject: Re: [Maxima] problem calling MAXIMA function at lisp level
From: Richard Fateman
Date: Sun, 12 Jan 2003 10:14:55 -0800
The treatment of upper/lower case for ANSI Common Lisp
has been a problem from the time the language description
was first published. The voices of reason (from the
unix camp) who wanted both cases, yielded to the traditionalists
of the DEC PDP-10 Lisps who wanted to map all typed in
characters to upper case.
Allegro CL comes in several versions. mlisp is the "modern"
all cases lisp. alisp is the ANSI uppercase lisp.
The use of maxima code from raw lisp should should work
as shown, and of course you can define in
lisp a function that starts with $ to become a maxima-level
function. The return values from such functions should
be compatible with the maxima data representation, since
they will ordinarily be simplified and displayed.
RJF
Wolfgang Jenkner wrote:
> go_furuya@infoseek.jp writes:
>
>
>>"Wang Yin" writes:
>>
>>>(C1) FOO(X, Y) := X + Y + 3;
>>>
>>> then, I press Ctrl-C to enter lisp level, and :
>>>
>>>MAXIMA>>(mfuncall '$foo 4 5)
>>>
>>> but I got the following answer:
>>>
>>>(($FOO SIMP) 4 5)
>>>
>>> not 12 as the manual says.
>>>
>>> Is the manual too old? Where can I find a good book for MAXIMA?
>>
>>This problem is caused by useing $foo not |$foo|.
>>(C1) foo(x,y):=x+y+3$
>>C2) :lisp(symbol-plist '|$foo|)
>>(MPROPS (NIL MEXPR ((LAMBDA) ((MLIST) $x $y) ((MPLUS) $x $y 3))))
>>
>>(C2) :lisp(MEVAL '(|$foo| 4 3))
>>10
>>(C2) :lisp(mfuncall '|$foo| 4 3)
>>10
>>
>
>
> Well, Wang Yin uses an uppercase FOO, which corresponds to the symbol
> |$FOO| (and $foo is read like |$FOO|). This means that everything
> should work as the manual says, and, in fact, under Clisp and SBCL it
> does so.
>
> Wolfgang
>
> _______________________________________________
> Maxima mailing list
> Maxima@www.math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima