Subject: Re: how to pass a list in clisp command line as a argument?
From: (Rob Warnock)
Date: 1999/12/07
Newsgroups: comp.lang.lisp
Message-ID: <82ipla$>
Stig E. Sand� <> wrote:
| Cren Q <> 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":

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
	(mapc #'print
	  (mapcar #'eval
	    (mapcar #'read-from-string *args*)))
	% foo "'(a b)" "'(+ 23 45)" "(+ 23 45)"
	(A B)
	(+ 23 45) 


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) 

Rob Warnock, 8L-846
Applied Networking
Silicon Graphics, Inc.		Phone: 650-933-1673
1600 Amphitheatre Pkwy.		FAX: 650-933-0511
Mountain View, CA  94043	PP-ASEL-IA