On 10/22/10, Gerd Kortemeyer <korte at lite.msu.edu> wrote:
> Is there any way (command-line option?) to make MAXIMA not ask any
> questions, but instead just deliver an error when it would have a question?
At present there isn't exactly any way to do that,
although it is somewhat reminiscent of the noninteractive
package which attempts to construct conditional expressions
instead of asking questions.
If you are interested to experiment with it, you can take the stuff
in share/contrib/noninteractive/asksign1.lisp (you can get the most
recent version from CVS or an installation package) from line 16
(defmvar $no_questions t) to the end of the file and load that
stuff into Maxima. Then any calls to asksign (e.g. via integrate
or limit or whatever) will cause an expression asksign(expr, foo)
to be throw, where expr is the expression of interest (e.g. n + 1 in
integrate(x^n, x)) and foo represents the possible signs (e.g. znz,
meaning zero or nonzero).
The output looks like this:
(%i4) integrate (x^n, x);
`throw' not within `catch':
asksign(n + 1, znz)
-- an error. To debug this try: debugmode(true);
Or if you put every call within catch you get stuff like this:
(%i7) catch (integrate (x^n, x));
(%o7) asksign(n + 1, znz)
so you can just inspect the result to see if the operator
is asksign or askprop (the other possibility with asksign1.lisp).
Bear in mind that asksign1.lisp is a bit of gross hackery
derived from some previous version of src/compar.lisp.
If you use it, I'm not responsible for hair loss / run-away pets /
fashion crises / etc.
I've taken the liberty of including the Maxima mailing list
on the list of recipients. Further correspondence on this
topic should be addressed to the list.
best,
Robert Dodier