From: Pascal B. <pj...@in...> - 2003-03-18 05:13:07
|
Sam Steingold writes: > > Notably,=20 > >=20 > > #!/bin/sh > > /usr/bin/clisp -M image.mem -x "(setq ext:*args* '($@))" > >=20 > > does not work because -x just executes one form then exits! > > indeed, as documented > <http://clisp.cons.org/clisp.html#opt-exec-expr> So I was wrong here, -x executes several forms (-x expressionS) . =20 > > How one can pass arguments to a saved image with a init-function? >=20 > <http://clisp.cons.org/clisp.html#opt-exec-expr> >=20 > $ clisp -M image.mem "" my-arg1 my-arg2 my-arg3 Any reason in particular why it does not use the standard (or at least, the classical) -- argument separator? You don't expect us to read the whole documentation, do you? I've searched for '--' in the manual page and since I've not found it I concluded erroneously that the feature was not there. > try >=20 > clisp -x '(defpackage "TEST") (defun test::f ())' Yes, it works. Thank you. I must confess that I infered that it expected only one form from my previous experience with emacs. Sorry. But since the ability to process several forms is already there, why not allowing several -x options too? > > - several -x options must be allowed, >=20 > clisp -x "(foo)" -x "(bar)" =3D=3D=3D clisp -x "(foobar)" Or perhaps: clisp -x "(foo) (bar)" > what do we need the sugar for? Convenience. To match expectation from people having used other similar programs. > > - clisp should not exit automatically after a -x form is processe= d. >=20 > this is an incompatible change of dubious value. > if you want -x, you are probably in a script or makefile and will have > to add (exit) as the last form. Once again, at least one pre-existing lisp (emacs) does it the other way. Why would you want to be incompatible with it and break expectations? > > Do not adjust your mind, there is a fault in reality. >=20 > Please do adjust your mind as documented above and update your > proposals accordingly. In any case, thank you for helping me seeing it the clisp way. :-) While it may be hard to ask for a full compatibility with the emacs command line arguments, (with respect to -x/--eval etc), I would suggest to add "--" as alternate separator for the arguments passed to ext:*arg* in addition to "". Note that it is sometimes hard to ensure the presence of an empty arguments. --=20 __Pascal_Bourguignon__ http://www.informatimago.com/ ---------------------------------------------------------------------- Do not adjust your mind, there is a fault in reality. |