Greetings,
First, thanks a lot to whoever adopted maxima to run under
cmucl. There were however still a few quirks I had to bypass for it to
actually run correctly, this made me wonder if I should look for newer
cmucl specific patches? I didn't have much luck with the CVS
version. Anyway, bypassing the quirks, maxima passes all the tests in
doc/tests.lisp, and blazingly fast:-)
Here is a summary of my fixes, intermixed with relevant diffs:
* *QUO is declared to be inline and ftype (function (* *) *), while
actually being ftype (function (number number) (values number
&optional integer)) This combination caused cmucl 18c x86f to
generate incorrect code, assuming the function would never be
called with integer arguments. The symptom of this was the COMPPI
function never returning. Putting a PROGN around the TRUNCATE to
explicitly get rid of the extra return value solves the problem
diff -rU 4 maxima-5.6/src/compat.lisp ../src/maxima-5.6/src/compat.lisp
--- maxima-5.6/src/compat.lisp Mon May 8 08:09:41 2000
+++ ../src/maxima-5.6/src/compat.lisp Wed Aug 8 00:14:24 2001
@@ -39,11 +39,11 @@
(proclaim '(inline *quo *dif))
#+cl
(DEFun *QUO (X Y)
(cond ((and (integerp x) (integerp y))
- (truncate x y))
+ (progn (truncate x y)))
(t (/ X Y))))
#+cl
(DEFun *DIF (X Y) (- X Y))
* My next point doesn't have a diff but is related to the build
process. When running (COMPILE-MAXIMA) followed by (SAVE-MAXIMA)
during one lisp session, some DEFMACROs in hyp.lisp (notably MABS)
remains defined in the restarted image. This is apparently not the
intention, see EVAL-WHEN in hyp.lisp. The symptom here is simple
expressions like x:0.1; abs(x^2-10); throwing a lisp error. I guess
it would be possible to explicitly undefine macros before saving the
image. A simpler solution is to quit cmucl after (COMPILE-MAXIMA),
then restart cmucl, run (COMPILE-MAXIMA) (This loads the already
compiled hyp.x86f respecting the intention of its EVAL-WHEN) and
finally (SAVE-MAXIMA)
* cmucl doesn't have EVALHOOK, thus :lisp from the maxima prompt
fails. This fix is probably not complete wrt *break-env* and
friends.
diff -rU 4 maxima-5.6/src/mdebug.lisp ../src/maxima-5.6/src/mdebug.lisp
--- maxima-5.6/src/mdebug.lisp Thu Apr 19 06:44:41 2001
+++ ../src/maxima-5.6/src/mdebug.lisp Mon Aug 6 21:45:07 2001
@@ -99,9 +99,10 @@
(setf (symbol-function gen) fun) (setf (get key prop) gen)
(setq fun gen)))
(cond (fun
(setq args (cons fun args))
- (evalhook args nil nil *break-env*)
+ #-cmu(evalhook args nil nil *break-env*)
+ #+cmu(eval args)
)
(t (format *debug-io* "~&~S is undefined break command.~%" key)))
)
* Not having the regex library installed, load-foreign fails during
image restart, but with an error other than FILE-ERROR. Fix is
obvious.
diff -rU 4 maxima-5.6/src/compile-cmulisp.lisp ../src/maxima-5.6/src/compile-cmulisp.lisp
--- maxima-5.6/src/compile-cmulisp.lisp Fri Apr 27 18:11:16 2001
+++ ../src/maxima-5.6/src/compile-cmulisp.lisp Sat Aug 4 21:41:34 2001
@@ -115,9 +115,11 @@
(ext:load-foreign *regex-lib*)
(load (maxima-path "src" "cmulisp-regex") :if-source-newer :compile)
(load (maxima-path "src" "cl-info") :if-source-newer :compile))
- (file-error ()
+ (error ()
(format t "~&Regex support files not found. Skipping regexp stuff for describe~%")))
))
(defvar *maxima-directory* nil)
Regards, Ole Myren Rohne