Colnew, etc.



On 3/11/11 5:18 AM, Michel Talon wrote:
> To understand the colnew wrapper i have written a small program, and i am 
> puzzled by a small glitch in the interface between maxima and lisp (if it is 
> relevant, my maxima is compiled with cmucl) The problem is that the same 
> call works in (%i3) below, doesn't work in (%i4) but works in (%i5)
> after having compiled f.  What is the explanantion of this behaviour, 
> please?
>
> niobe% maxima
> (%i1) f(x):=[x^2,x^3];
>                                          2   3
> (%o1)                          f(x) := [x , x ]
> (%i2) load("essai.lisp");
> (%o2)                             essai.lisp
> (%i3) ?conversion(f);
> (%o3)                       {Array:  #(25.0 125.0)}
> (%i4) :lisp(conversion #'$f)
>
> Maxima encountered a Lisp error:
>
>  Error in FDEFINITION:  the function $F is undefined.
>
That's because f(x) is not a Lisp function yet.  You can see by using

:lisp (symbol-plist '$f)

The mexpr property is the definition.  When you compile it, it becomes a
lisp function.

Ray