From: Nathan Thern <address@hidden>
Date: Tue, 9 Dec 2014 16:55:48 -0500
I should mention that I also tried adding a dash ("calc" => "-calc")
in the "argument-command-line-parser" line:
(argument-command-line-parser "-calc" #f calc)
Same error.
By the time your script installs your command line parser, the command
line has already been parsed.
If you separate the machine options from your script's options with
"--" you will not get the warning. The command-line procedure will
return the words following "--" as a list of strings.
Compiling scripts is not recommended. You probably want to do
something like the following.
cat >fib-script.scm <<EOF
(load "fib-program.com")
(let ((words (command-line)))
(if (not (= (length words) 1))
(error "One integer argument is required..."))
(let* ((n-str (car words))
(n (string->number n-str))
(fib-n-str (number->string (fib n))))
(display (string-append n-str"th Fibonacci number is "fib-n-str"\n"))))
(%exit)
EOF
cat >fib-program.scm <<EOF
(declare (usual-integrations))
(define (fib m)
(if (< m 2)
m
(+ (fib (- m 1)) (fib (- m 2)))))
EOF
mit-scheme <<EOF
(compile-file "fib-program")
EOF
mit-scheme --batch-mode --load fib-script -- 10