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

Re: [Scheme-reports] command-line



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@x  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@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports