[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[MIT-Scheme-devel] How to run a script and exit?

From: SB
Subject: [MIT-Scheme-devel] How to run a script and exit?
Date: Mon, 9 Sep 2019 01:16:19 +0800

How can I run a Scheme script and exit? For example, if I have a file named 'myscript.scm` containing:

    (display "Hello!")
    (display (+ (read) 1))

How can I run the file using MIT Scheme?

Contrary to the convention in just about every other programming language implementation, `mit-scheme myscript.scm` is not valid on the command line.

There have been fairly popular questions of Stack Overflow about this problem:


Most of the "solutions" involve input redirection ('mit-scheme --quiet < myscript.scm`), but this method fails when the script uses input procedures (e.g. read, read-char, read-line. etc.) because the input redirection causes the input procedures to read from the file rather than prompt the user for input.

Is there a way to run a Scheme script using MIT Scheme? If so, how?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]