noninteractive mode



hello,

questions about using Maxima as the back end for a
web interface or some other kind of interface come up
from time to time, most recently today. aside from
web interfaces and graphical user interfaces, it seems
like tools which are at present mostly numerical
(either spreadsheets like Gnumeric or console i/o
like Octave or R) could make use of Maxima. also,
programs which use Lisp or Scheme as an extension
language could conceivably link into Maxima via the
extension language.

i believe that a completely noninteractive mode would
make it much easier to integrate Maxima into other programs
which want to make use of symbolic computation.

toward this end i've cheesed together some crufty hacks
which you can see here --

  http://maxima.sourceforge.net/wiki/index.php/Noninteractive%20mode

the name of the game (as i see it) is to have asksign and askinteger
throw something instead of trying to interact with the user.
then the top-level evaluator constructs a conditional for each
possible value of the expression asksign / askinteger would have
asked about.

e.g. integrate (exp(a*x), x, 0, inf)  =>
  if a < 0 then - 1/a elseif equal(a, 0) then 0 else merror(Integral
is divergent)

to make this really workable it would be necessary to plug all
the holes which lead to user interaction. asksign / askinteger are
just the biggest ones which come to mind.

i believe it is useful to compute all alternatives instead of
choosing only one, so this asksign / askinteger replacement
has substantial value in itself,  aside from making it easier to
plug into other programs.

anyway perhaps this will be interesting to someone.

all the best,
robert dodier