Subject: [clisp-list] [Cygwin] Command-line options: strange behaviour

From: VAUCHER L Ext SIRES <[email-masked]>
Date: Wed Jun 30 02:15:04 2004

Hi.

  I'm currently using the Cygwin package of clisp 2.33.1, and
I think command line arguments are processed somewhat differently
that what is advertised in the man (or with --help). My problem
is with -i and the 'terminal' lisp-file argument.

  When I use only the terminal lisp-file argument, everything
works as expected : the first line (#!/.../clisp) is not
interpreted as lisp code, my RC file is not loaded, command-
line arguments situated after the lisp-file name are available
in ext:*args* and when the file is loaded, clisp terminates.
Example: 'clisp toto.lisp 1 2 3'

  But as soon as I try using a -i initfile option in my command
line, it does not work anymore as above :
  - the #! line in the lisp-file causes a read error,
  - my RC file is loaded prior to everything else, even the initfile,
  - no command-line arguments are available (ext:*args* is NIL),
  - worse, trailing command-line arguments are interpreted as
     lisp files to be loaded
  - and finally, clisp enters a REPL.
Example: 'clisp -i initfile.lisp toto.lisp 1 2 3'

  There is no indication of incompatibility between -i options
and the terminal lisp-file argument in the man, so I am a bit
surprised. I also have a clisp distribution on Debian GNU/Linux
but I have not tried the same experiment yet.

  Is it a bug? Is it an 'undocumented feature'? Is there some
workaround available?

  I'd like to have answers to those questions but I want to
thank all contributors to the clisp projet for their great
work.

Laurent.

---

From: Sam Steingold <[email-masked]>
Date: Wed Jun 30 06:48:14 2004

> * VAUCHER L Ext SIRES <[email-masked]> [2004-06-30 11:14:00 +0200]:
>
> My problem is with -i and the 'terminal' lisp-file argument.
>
>   There is no indication of incompatibility between -i options and the
> terminal lisp-file argument in the man, so I am a bit surprised.

what incompatibility?
these are entirely different options, completely unrelated.

>   Is it a bug? Is it an 'undocumented feature'? Is there some

this is precisely the intended behavior, as documented.

"-i" means load an "init" lisp file and proceed to repl or script

"terminal" means a lisp script: execute standalone.

these are different options with different purposes.

if you are familiar with bash, you might find the following simile
helpful: "-i foo.lisp" corresponds to ". foo.sh" (or "source foo.csh"),
while the "script" or as you call it "terminal" option corresponds to
running a shell script.

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.honestreporting.com>
My other CAR is a CDR.