[Maxima] Error catching in Mockmma

Richard Fateman 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 
you selected)

replace this

#+kcl   (setq h (multiple-value-bind
	(iserr val)
	(system:error-set (list 'meval (list 'quote hin)))
	(if iserr (list 'Hold hin) val)))


by 

(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?

RJF








More information about the Maxima mailing list