[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Axiom-developer] Re: mathml hex(10) patch
From: |
Waldek Hebisch |
Subject: |
[Axiom-developer] Re: mathml hex(10) patch |
Date: |
Sun, 16 Dec 2007 10:44:11 -1100 (SST) |
Arthur Ralfs wrote:
> From: Waldek Hebisch <address@hidden>
> > You wrote:
> > > Tim, Waldek,<br><br>This patch is a band-aid for the
> > hex(10) bug.
> > <snip>
> > > @@ -1285,6 +1307,10 @@
> > > -- where it arises. Removed 2007-02-14
> > > concat(concat("<mtext>",str),"</mtext>")
> > > -- if we get to here does that mean it's a variable?
> > > + -- test for something like #\A and strip off #\
> > > + str.1 = char "#" and str.2 = char "\" =>
> > >
> > + u : US := segment(3,len)$US
> > >
> > + concat ["<mi>",str.u,"</mi>"]
> > > concat
> > ["<mi>",str,"</mi>"]> l : L E := (expr pretend L E)
> > > null l => blank
> > >
> >
> > I wonder if we can get here with a string -- for string this is
> > clearly wrong. AFAICS the start of 'hex(10)' problem is in
> > the line:
> >
> > stringify expr == (object2String$Lisp expr)@S
> >
> > object2String converts character using _Lisp_ rules:
> >
> > object2String x ==
> > STRINGP x => x
> > IDENTP x => PNAME x
> > NULL x => '""
> > PAIRP x => STRCONC(object2String first x,
> > object2String rest x)
> > WRITE_-TO_-STRING x
> >
> > so you get '#\A' here. I am not sure if we ever want '#\A' in
> > "math" output -- if no we could just use a function which would
> > convert characters to length 1 strings.
> >
> Do you think we can rewrite the stringify function to do the
> right thing? I'm not sure how to proceed. I copied stringify
> from the TeX domain.
>
The following add a 'mathObject2String' function to convert characters
to length one strings and all other object using old rules.
--- trunk.bb/src/interp/format.boot 2007-12-16 17:25:14.000000000 +0100
+++ trunk/src/interp/format.boot 2007-12-16 22:22:40.000000000 +0100
@@ -706,6 +706,10 @@
concat("attribute: ",form2String form)
form2String x
+mathObject2String x ==
+ CHARACTERP x => COERCE([x],'STRING)
+ object2String x
+
object2String x ==
STRINGP x => x
IDENTP x => PNAME x
given this function it should be enough to change stringify to call
mathObject2String (instead of object2String).
Concerning TeX: TeX output has the same problem...
--
Waldek Hebisch
address@hidden