[R6RS] Script command-line arguments

Anton van Straaten anton at appsolutions.com
Tue Aug 22 11:54:04 EDT 2006

Michael Sperber wrote:
> Can someone remind me how scripts get at their command-line arguments?
> I'm guessing it's a procedure
> (command-line-arguments)
> that returns a list?  Or a vector?  Anway, I assume that the first
> element of that sequence is some implementation-dependent string
> naming the script itself, and the rest are the "real" arguments.

Kent has been proposing a procedure "command-line" which returns a 
"nonempty list of strings representing the command line; first is the 
executable name, remainder are command-line arguments"
(from https://r6rs.scheming.org/node/262#comment-1547, etc.)

...which seemed fine to me.

> ... and what library is this in? :-)

Base, of course, along with everything else. :-P

More seriously, I'd put in a "script" library, along with the 
environment variable accessing procedures which we haven't defined.  I 
propose get-environment-variable and get-environment, with semantics 
equivalent to lookup-environment-variable and environment->alist from 
(some version of?) Scheme 48.


More information about the R6RS mailing list