Re: [Scheme-reports] command-line John Cowan 04 Apr 2012 17:16 UTC

Bill Schottstaedt scripsit:

> Outside Windows, how do I get the command line in a
> scheme implementation that does not have access to
> the "main" function?  /proc/cmdline is apparently unsafe.

This mailing list is for Scheme standardization.  There is no standard
way to do what you want, so you have to look at the documentation for
the Scheme implementation you are using.

R7RS-small will have the procedure `command-line`, which returns the
command line as a list of strings.  Currently, Racket, Gambit, Bigloo,
scsh, Guile, Kawa, Chibi, Ikarus/Vicare, Ypsilon, Mosh, IronScheme,
KSi support `command-line` more or less, but not very consistently.
In particular, sometimes the car of the list is argv[0] or something
like it, but sometimes it is argv[1].  R7RS takes the former view.

--
John Cowan  cowan@ccil.org  http://ccil.org/~cowan
Any sufficiently-complicated C or Fortran program contains an ad-hoc,
informally-specified bug-ridden slow implementation of half of Common Lisp.
        --Greenspun's Tenth Rule of Programming (rules 1-9 are unknown)

_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports