I want to evaluate a script from makefile and exit, like this
mit-scheme --load "fact.scm"
However, after it evaluates the file, it does not exit, and the repl appears; if I try the (exit)
primitive, it asks for confirmation y/n. Is it possible to solve this ?
To run Scheme from within Emacs, start emacs, and then use the command M-x run-scheme. (That is, press the ESC key, then x then at the prompt run-scheme ). This will create a buffer called *scheme*, which will be in "inferior scheme mode".
The easiest way to write Scheme code is to use an editor like Emacs and execute run-scheme . After that you can send any s-expression with Ctrl-x Ctrl-e from the editor to the interpreter. Emacs shows the result in the REPL window.
Just let our command close stdin of the mit-scheme process automatically, e.g.
echo | mit-scheme --load sample.scm
We can expand it to a script function; here's my unskilled implementation:
function mschm () {
IFS=""
for arg in $@
do
echo | mit-scheme --load $arg
done
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With