chibi-scheme/tests/run/lib/hello.sld
Masanori Ogino 361e8e6590 Remove argv[0] from the arguments of main_symbol.
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>
2017-06-10 08:54:49 +09:00

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))))