How deal list function arguments in translate and compile ?
Subject: How deal list function arguments in translate and compile ?
From: Niitsuma Hirotaka
Date: Thu, 18 Jun 2009 14:40:09 +0900
I try to compile function who has list argument
% wf(v):=block(mode_declare(completearray(v[2] ),float),return(v[1]+v[2]))
Before translate it works
%wf([1,2]) /* -> 3 */
But after translate
%translate(wf)
%wf([1,2])
Maxima encountered a Lisp error:
EVAL: undefined function $V
Automatically continuing.
To reenable the Lisp debugger set *debugger-hook* to nil.
In the translated code,
%compfile("tmp.lisp",wf)
$ more tmp.lisp
...
RETURN (+ ($V 1 ) ($V 2)
...
$V is dealed as function.
How to deal function arguments as list or matrix?