Re: Technical reasons for some options taken on design of MathML

juanrgonzaleza@canonicalscience.com wrote:
> Unfortunately, the w3c MathML specification does not explain to readers
> the reasons for the several options taken by its authors.
> 
> - what is the argument to use some like
>    <apply><divide/><ci>A</ci><cn>2</cn></apply>
> instead of shorter
>    <divide><ci>A</ci><cn>2</cn></divide> ?
> - What is the reason for
>    <apply><plus/><cn>5</cn><cn>8</cn></apply>
> instead of calculator-like
>    <apply><cn>5</cn><plus/><cn>8</cn></apply> ?

I don't know the "official" reason for these constructs but my guess 
is that they follow the logic that <apply> is a function 
application. In programming terms one would convert
markup such as
   <apply><plus/><cn>5</cn><cn>8</cn></apply>
to a computer program
   plus(5,8)
where the "plus" is name of the function to call. Apply always takes 
the first child (from DOM tree) as the function to use and rest of 
the childs as parameters for that function.

If you think that everything is a function, then writing "A/2" 
really seems like a shorthand notation for divide(A,2).

> - What is the reason for
>    <msup>base <mrow>index1 index2</mrow></msup>
> instead of
>    base<sup>index1 index2</sup>
> or the
>    base^{index1 index2}

The reason the last one isn't used is that it doesn't follow the XML 
way of doing things and (it seems that) W3C has decided to use XML 
for markup of practically everything.

I guess the reason the first one of the above XML variants is used 
is that it makes it perfectly clear which part the superscript is 
for. Consider the following

   <mi>a</mi><mi>b</mi><sup><mi>c</mi></sup><mi>d</mi>

Does that mean "((ab)^c)d" or "a(b^c)d" or something else? Again, if 
you think that XML is *the* way to go, then these design choices 
logically follow. "Everything is a tree".

-- 
Mikko

Received on Thursday, 30 March 2006 09:51:02 UTC