stopping batch()



Albert Reiner <areiner@tph.tuwien.ac.at> writes:

> is there a way to cause batch() or load() to stop at some point in a
> file, and Maxima to return to the REPL?  I am thinking of something
> like \endinput in TeX.

Apparently, nobody is aware of a user level function doing just this?

Basically, in order to get back to the Maxima top-level loop you
probably want to THROW the MACSYMA-QUIT tag, like

(defmfun $endinput () (throw-macsyma-top))

Note that $batch and $batchload (hence $load) won't return in this
case; this is the usual behaviour for $batch but not for $batchload.

Alternatively, you could force CONTINUE and hence $batch (but not
$batchload) to return by THROWing ABORT-DEMO.

In any case, Maxima will properly unwind the variable bindings, $local
stuff and the function call stack, so you can do these things even
from within some block.

Wolfgang