2 ;; Copyright Leo Butler (leo.butler@member.fsf.org) 2013
3 ;; Released under the terms of GPLv2
7 (defvar *displa
* (symbol-function 'displa
))
8 (defvar *maxima-outchar
* $outchar
)
9 (defvar *smath-outchar
* '$%s
)
12 (defun $smath_displa
(form &optional
(sm-rules (if (boundp '$sm_rules
) $sm_rules
)))
13 "Display FORM by APPLY1-ing the rules in SM-RULES to the EXPR in FORM."
14 (declare (special $sm_rules
*alt-display1d
*))
16 (let ((rules (cdr sm-rules
))
20 (list (first form
) (second form
)
21 (dolist (rule rules expr
)
22 (setf expr
(mfuncall '$apply1 expr rule
)))))))
25 (funcall *displa
* form
))))
27 (defun $to_sm_display
()
28 "Set-up Maxima to use SMATH_DISPLA to display output."
29 (declare (special *alt-display1d
* $outchar
*smath-outchar
*))
30 (setf *alt-display1d
* (symbol-function '$smath_displa
)
31 $outchar
*smath-outchar
*))
33 (defun $to_mx_display
()
34 "Return Maxima to use standard DISPLA for 1d output."
35 (declare (special *alt-display1d
* $outchar
*maxima-outchar
*))
36 (setf *alt-display1d
* nil
37 $outchar
*maxima-outchar
*))
39 (defun $smkill
(&optional s
)
40 "Execute KILL(S), then re-LOAD smath and set display."
42 (mfuncall '$load
"smath.mac")