[Maxima] Error catching in Mockmma
fateman at cs.berkeley.edu
Sun Nov 29 22:25:26 CST 2009
hmonroe.maxima at huntermonroe.com wrote:
> Before releasing Mockmma (a Mathematica emulator), I would like to improve the error catching. Right now errors throw the user back into Maxima, but I would like them to be thrown back into Mockmma.
I think that what you need is something like this ... (not in the piece
#+kcl (setq h (multiple-value-bind
(system:error-set (list 'meval (list 'quote hin)))
(if iserr (list 'Hold hin) val)))
(setq h (handler-case (meval hin)
(error (q) (format t "~%An error was produced in MockMMa: ~s") (list 'Hold hin))
(noerror (q) q)))
but I have not tested it.
assuming that GCL now has handler-case.
whether this has the desired effect, I don't know, since you were kind of vague on that.
I am also assuming that the meval is the mockmma::meval not maxima::meval, etc.
I still view the essence of MockMMA as the reverse engineering of the Mathematica pattern matcher
and rule system. Is it still disabled in your version?
More information about the Maxima