~ chicken-r7rs (master) d8529b8bcaca39a50cef3e94e56e1fdd8e95add3


commit d8529b8bcaca39a50cef3e94e56e1fdd8e95add3
Author:     Evan Hanson <evhan@foldling.org>
AuthorDate: Thu May 30 08:40:18 2013 +0000
Commit:     Evan Hanson <evhan@foldling.org>
CommitDate: Thu May 30 08:40:18 2013 +0000

    Add command-line procedure

diff --git a/r7rs.scm b/r7rs.scm
index 409861e..583817c 100644
--- a/r7rs.scm
+++ b/r7rs.scm
@@ -11,6 +11,7 @@
  file-error?
  ; TODO guard
  ;; System interface
+ command-line
  exit
  emergency-exit
  )
@@ -68,6 +69,14 @@
 
 ;; Should these go in a separate module (process-context)?
 
+(define command-line
+  (let ((command-line #f)
+        (arguments (command-line-arguments)))
+    (lambda ()
+      (unless command-line
+        (set! command-line (cons (program-name) arguments)))
+      command-line)))
+
 (define (->exit-status obj)
   (cond ((integer? obj) obj)
         ((eq? obj #f) 1)
Trap