[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Scheme-reports] (command-line) needs to specify argv behavior
- To: scheme-reports@x
- Subject: [Scheme-reports] (command-line) needs to specify argv behavior
- From: Per Bothner <per@x>
- Date: Wed, 03 Aug 2011 11:15:47 -0700
This has been discussed before, but I don't see a ticket for it.
The definitions of (command-line) is:
Returns the command line arguments passed to the process
as a list of strings.
It needs to clarify if this list includes the command used to
invoke the process - i.e. C's argv.
Making it implementation-dependent makes it useless.
However, it is possible to make the first car be implementation-dependent.
I.e. (car (command-line)) corresponds to C's argv, if known,
and is "" if unknown.
A complication is there may be multiple command names:
/usr/local/bin/myscheme myprog.scm a b c
where myscheme is the Scheme "interpreter", myprog.scm is the Scheme
application, and (a b c) are the actual use commands. In this case,
what should (command-line) return?
java -classpath kawa.jar -Xmx120 kawa.repl a b c
So perhaps command-line should only return "user" command-line arguments.
I.e. in the above examples:
("a" "b" "c")
The result should not include the command name used to invoke the
or (if the process is a Scheme evaluator) the name of the Scheme file
evaluated or evaluator-specific options.
Perhaps there should be a separate function to get the "invocation
(command-invoker) ==> ("/usr/local/bin/myscheme" "myprog.scm")
(command-invoker) ==> ("java" "-classpath" "kawa.jar" "-Xmx120"
Some implementations (including Kawa) may have difficulty implementing
Allowing command-line (and command-invoker) to return a list of
(like symbol->string does) would avoid the need for an extra copy operation
on Kawa, but that is pretty minor.
Scheme-reports mailing list