Re: [Maxima] problem calling MAXIMA function at lisp level



Hi Wang

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

Be careful that your define function foo(x,y) is not lisp function
until compile on MAXIMA language.
see blow.

(C2) :lisp(symbol-function '|$foo|)
*** - SYMBOL-FUNCTION: |$foo| has no global function definition
(C3) compile(foo);
(D3)                                 [foo]
(C4) :lisp(symbol-function '|$foo|)
#

Gosei Furuya (go_furuya@infoseek.jp)

> Hi,
> 
>   I tried to  do something as the MAXIMA manual says:
> 
>   at MAXIMA level, I define a function:
> (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?
> 
> 
> --
> Wang Yin
> DA Lab, Tsinghua University,
> 100084
> Beijing China
> _______________________________________________
> Maxima mailing list
> Maxima@www.math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima