Stig E. Sand� <stig@ii.uib.no> wrote:
+---------------
| Cren Q <cq@fd.com> wrote:
| >clisp foo.lsp '(a b) doesn't work.
| >how can I pass it a list like '(a b)?
...
| user::*args* is a list of the arguments given (last) on the
| command line. I think it is documented in implementation.html
+---------------
Yup, it's documented both in the man page and in more detail in the
implementation notes, "Extensions-2.8. Quickstarting delivery with CLISP":
http://clisp.cons.org/~haible/documentation/clisp/doc/clisp.html
http://clisp.cons.org/~haible/documentation/clisp/doc/impnotes.html#quickstart
But if he wants to end up with actual lists (or other Lisp forms), then
he probably also wants to use READ-FROM-STRING, since *ARGS* is a list of
strings, only. For example:
% cat foo
#!/usr/local/bin/clisp
(mapc #'print
(mapcar #'eval
(mapcar #'read-from-string *args*)))
% foo "'(a b)" "'(+ 23 45)" "(+ 23 45)"
(A B)
(+ 23 45)
68
%
-Rob
p.s. If you can't use the "#!" hack for some reason,
it's also usable this way:
% clisp foo "'(a b)" "'(+ 23 45)" "(+ 23 45)"
(A B)
(+ 23 45)
68
%
-----
Rob Warnock, 8L-846 rpw3@sgi.com
Applied Networking http://reality.sgi.com/rpw3/
Silicon Graphics, Inc. Phone: 650-933-1673
1600 Amphitheatre Pkwy. FAX: 650-933-0511
Mountain View, CA 94043 PP-ASEL-IA