[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Several comments

This page is part of the web mail archives of SRFI 22 from before July 7th, 2015. The new archives for SRFI 22 contain all messages, not just those from before July 7th, 2015.



>>>>> "Marc" == Marc Feeley <feeley@xxxxxxxxxxxxxxxx> writes:

Marc> and "scheme-script" would always invoke "script-main" after loading a
Marc> script.
>> 
>> I can imagine going with that.  Opinions, anyone else?

Marc> Can you explain your position on the other alternatives.  In
Marc> particular the second one which is my preference:

Marc>   #! /bin/sh
Marc>   "exec" "scheme-script" "$0" "$@"
Marc>   (define (main arg1 arg2)
Marc>     (write (+ (string->number arg1) (string->number arg2))))
Marc>   (apply main (script-arguments))

It has the problem mentioned in the rationale: I type C-c C-l in
XEmacs (or "Execute" in DrScheme), and the thing runs when it
shoudn't.

Marc> My third alternative, based on the implicit call of a
Marc> "script-main" procedure, requires the compiler to know it is
Marc> compiling a script so it has to be given a special compilation
Marc> option, or detect that the file being compiled starts with "#!"
Marc> (actually it is a bit more complicated because it is the linker
Marc> that has to know it is generating an executable and one of the
Marc> source files was a script).

Yes.

-- 
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla