create Maxima list from multiple return values of a Lisp function
Subject: create Maxima list from multiple return values of a Lisp function
From: Edwin Woollett
Date: Thu, 16 Jun 2011 14:56:45 -0700
On June 16, 2011, Stavros Macrakis wrote:
-------------------------------------------
> (cons '(mlist simp) (multiple-value-list (rename-file "foo.txt"
> "bar.txt")))
> But of course the individual elements of the result don't print correctly.
-------------------------
When I try to use this in Maxima I get a lisp error:
-------------------------
(%i1) :lisp (probe-file "foo.txt")
#pC:/work2/foo.txt
(%i1) to_lisp();
Type (to-maxima) to restart, ($quit) to quit Maxima.
MAXIMA> (defun $rname (mfrom mto)
(cons '(mlist simp) (multiple-value-list (rename-file mfrom mto))))
$RNAME
MAXIMA> rname ("foo.txt","bar.txt");
Maxima encountered a Lisp error:
Error in EVAL [or a callee]: The variable RNAME is unbound.
Automatically continuing.
To reenable the Lisp debugger set *debugger-hook* to nil.
MAXIMA>
Maxima encountered a Lisp error:
Error in READ [or a callee]: A comma has appeared out of a backquote.
Automatically continuing.
To reenable the Lisp debugger set *debugger-hook* to nil.
MAXIMA>
"bar.txt"
--------------------------------------
>>I am using GCL in my windows binary
>>Maxima simply as a way to learn some
>>Lisp to Maxima tricks.
>>Both Raymond Toy and Leo Butler have provided methods
>>of turning a Lisp list into a Maxima list.
>>gcl:rename_file returns three values.
>>How can I turn these into a Maxima list?
>>-----------------------------
>>(%i1) :lisp (rename-file "foo.txt" "bar.txt")
>>#pbar.txt
>>#pC:/work2/foo.txt
>>#pC:/work2/bar.txt
-------------------
Ted Woollett
windows (gcl) 5.24.0
_______________________________________________
Maxima mailing list
Maxima at math.utexas.edu
http://www.math.utexas.edu/mailman/listinfo/maxima