[plt-scheme] R6RS `(command-line)' question

From: Andreas Rottmann (a.rottmann at gmx.at)
Date: Thu Apr 15 17:19:13 EDT 2010


Given this program:

;;; ---- 8< -----

(import (rnrs))

(write  (command-line))
;;; ---- 8< -----

I get the following result running it with plt-r6rs:

| % plt-r6rs ./+tmp/test-plt.sps 
| ("/home/rotty/.system/bin/plt-r6rs")

I wonder if this is intentional; I expected to get the program's path in
the first element of the list returned by `command-line', and this is
indeed what (at least) Ikarus and Ypsilon do:

| % ikarus --r6rs-script ./+tmp/test-plt.sps
| ("./+tmp/test-plt.sps")

I think the latter behaviour is more useful, as a program can then
determine its own location (relative to the working directory in that
case), and R6RS seems (to me) to suggest the latter behaviour (Chapter
10, about the return value of `command-line'):

  The first element is an implementation-specific name for the running
  top-level program.

Regards, Rotty
Andreas Rottmann -- <http://rotty.yi.org/>

Posted on the users mailing list.