mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-20 14:19:18 +02:00
While the (command-line) in (scheme process-context) contains the command name (argv[0]), SRFI 22 specifies that the interpreter passes the command-line arguments except argv[0] to the script. Fix #413. Signed-off-by: Masanori Ogino <masanori.ogino@gmail.com>
11 lines
323 B
Scheme
11 lines
323 B
Scheme
(define-library (hello)
|
|
(import (scheme base))
|
|
(begin
|
|
(define (main args)
|
|
(write-string "Hello, ")
|
|
(write-string (if (pair? args) (car args) "world!"))
|
|
(newline))
|
|
(define (bye args)
|
|
(write-string "Goodbye, ")
|
|
(write-string (if (pair? args) (car args) "world!"))
|
|
(newline))))
|