grzegorzmazur / yacas

Computer calculations made easy
http://www.yacas.org
GNU Lesser General Public License v2.1
124 stars 24 forks source link

escaped chars and OpenMath #306

Closed MarcoCostantini closed 4 years ago

MarcoCostantini commented 4 years ago

When converting from openmath to yacas (see #298), the line If (ec = "&", s := s : "&"); must be after the other escapes

When converting from yacas to openmath (see https://github.com/grzegorzmazur/yacas/commit/42b7c8a53da5c0b7f2593180092c9d95f0c03079 ) add the line c := If (c = "&", "&", c); before the other escapes

MarcoCostantini commented 4 years ago

for instance, the string "&lt;" must became "<OMOBJ><OMSTR>&amp;lt;</OMSTR></OMOBJ>" and vice versa

grzegorzmazur commented 4 years ago

Hi,

Are you sure? I mean your example seems to work:

In> OMForm("&lt;")
<OMOBJ>
  <OMSTR>&amp;lt;</OMSTR>
</OMOBJ>
Out> True
In> FromString("<OMOBJ><OMSTR>&amp;lt;</OMSTR></OMOBJ>")OMRead()
Out> "&lt;"

And with respect to ordering of the substitution cases, they are actually independent of each other, or at least I believe they are :) If no, could you please provide an example when the ordering does matter?

Cheers, Grzesiek