aboutsummaryrefslogtreecommitdiff
path: root/src/interp/i-output.boot
diff options
context:
space:
mode:
authoralfredoport <doyenatccny@gmail.com>2008-03-16 20:08:29 +0000
committeralfredoport <doyenatccny@gmail.com>2008-03-16 20:08:29 +0000
commitd9b9f67266bcb24e7bec1a26afaf062b376d450e (patch)
treeeacaab35984aba4428bb306858974bcebed48ff0 /src/interp/i-output.boot
parent64a98e2f75407a020ed217227ad0e6e6a3730800 (diff)
downloadopen-axiom-d9b9f67266bcb24e7bec1a26afaf062b376d450e.tar.gz
Add support for MathML output
Diffstat (limited to 'src/interp/i-output.boot')
-rw-r--r--src/interp/i-output.boot12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/interp/i-output.boot b/src/interp/i-output.boot
index f08cf82f..2f45ce54 100644
--- a/src/interp/i-output.boot
+++ b/src/interp/i-output.boot
@@ -1377,11 +1377,22 @@ texFormat1 expr ==
FORCE_-OUTPUT $texOutputStream
NIL
+mathmlFormat expr ==
+ mml := '(MathMLFormat)
+ mmlrep := '(String)
+ formatFn := getFunctionFromDomain("coerce",mml,[$OutputForm])
+ displayFn := getFunctionFromDomain("display",mml,[mmlrep])
+ SPADCALL(SPADCALL(expr,formatFn),displayFn)
+ TERPRI $mathmlOutputStream
+ FORCE_-OUTPUT $mathmlOutputStream
+ NIL
+
output(expr,domain) ==
if isWrapped expr then expr := unwrap expr
isMapExpr expr =>
if $formulaFormat then formulaFormat expr
if $texFormat then texFormat expr
+ if $mathmlFormat then mathmlFormat expr
if $algebraFormat then mathprintWithNumber expr
categoryForm? domain or domain in '((Mode) (Domain) (Type)) =>
if $algebraFormat then
@@ -1398,6 +1409,7 @@ output(expr,domain) ==
if $algebraFormat then
mathprintWithNumber x
if $texFormat then texFormat x
+ if $mathmlFormat then mathmlFormat x
(FUNCTIONP(opOf domain)) and
(printfun := compiledLookup("<<",'(TextWriter TextWriter $), evalDomain domain))
and (textwrit := compiledLookup("print", '($), TextWriter())) =>