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

From: VAUCHER L Ext SIRES <[email-masked]>
Date: Wed Jun 30 07:09:01 2004

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

  That's what I hoped for.

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

  This is precisely not what I get. It seems that the -i
option automatically triggers the REPL mode and forbids the
script mode.

  I'll try to explain what I get and what I thought I'd get after
reading the docs.

  Suppose I've got an init file called "initfile.lisp" that
does --you guess-- some initialization work, like setting
some custom variables or such things.
  Suppose, then, that I've got another file that I wish to use
as a script (the name is definitely better that my 'terminal'
thing attempt). This script really 'drives' the program and
as such, needs to have access to remaining command-line
arguments. After parsing those arguments, the script proceeds
to real work. I call this file "script.lisp".

  Well, what I would like to do is run the script after having
done some initialization. So I type at the shell prompt
# clisp -i initfile.lisp script.lisp arg1 arg2

  What I hoped was that the [-i initfile.lisp] arguments
were taken together as meaning 'load the initfile.lisp
file before anything else', and the [script.lisp arg1 arg2]
part as meaning 'run script.lisp as a script, with arguments
arg1 and arg2 in ext:*args*' and exit when done.

  What I get is that 'initfile.lisp' 'script.lisp' 'arg1'
and 'arg2' are all treated as if they had been specified
as -i initfile.lisp -i script.lisp -i arg1 -i arg2,
which is definitely not what I thought.

  I also tried
# clisp -i initfile.lisp -q script.lisp arg1 arg2
  thinking that maybe another option in between file
names would make my intent clearer to clisp arguments
interpretation, but the result is the same.

  I hope I have made my 'question' clearer than it was in
the initial post.

  Thanks.

Laurent.

---

From: Sam Steingold <[email-masked]>
Date: Wed Jun 30 07:30:20 2004

> * VAUCHER L Ext SIRES <[email-masked]> [2004-06-30 16:07:56 +0200]:
>
> This is precisely not what I get.

the appended patch fixes the bug.

thanks!

-- 
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>
Just because you're paranoid doesn't mean they AREN'T after you.

--- spvw.d	25 Jun 2004 15:30:51 -0400	1.302
+++ spvw.d	30 Jun 2004 10:27:15 -0400	
@@ -2129,6 +2129,7 @@
             argv_selection_array[argc-1- argv_expr_count++] = arg; break;
           default: NOTREACHED;
         }
+        argv_for = for_exec;
       }
     }
     batchmode_p = /* '-c' or '-x' or file => batch-mode: */