> Mon, Sep 9, 2019 at 5:10 AM Taylor R Campbell <campb...@mumble.net>
>
> Could do something like
> mit-scheme --eval '(bind-condition-handler (list condition-type:error)
(lambda (c) c (exit 123)) (lambda () (load "script") (exit 0)))'
> (It is kind of silly that something like this is not built-in.)

:-) But this solution also prints ';Loading "script.scm"... ;... done' to
stdout. This side effect may be undesirable for many.

Will the maintainers of MIT Scheme consider adding the ability to run
scripts using the mit-scheme executable? Something like 'mit-scheme
myscript.scm' on the command line. Possibly something that allows Scheme
code to be turned into an executable script by adding a shebang (e.g.
#!/usr/bin/mit-scheme). It is very inconvenient that there is currently no
obvious way to do any of this.

Judging by the number of views and the popularity of this 10+ year question
(
https://stackoverflow.com/questions/903968/how-do-i-execute-a-scm-script-outside-of-the-repl-with-mit-scheme),
I would guess that this is a fairly common problem. Even the answers on
Stack Overflow are all wrong, because the use of shell input redirection
messes with input procedures (e.g. read, read-line, etc.) if they are used.
_______________________________________________
MIT-Scheme-devel mailing list
MIT-Scheme-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/mit-scheme-devel

Reply via email to