mailing-list for TeXmacs Users

Text archives Help


Patch: <postcript> and arithmetic logical and conditional markup


Chronological Thread 
  • From: David Allouche <address@hidden>
  • To: address@hidden
  • Subject: Patch: <postcript> and arithmetic logical and conditional markup
  • Date: Mon, 24 Dec 2001 01:05:30 +0100

Here is a not so little patch I have cooked for you.

It all started when I tried to fix a hole in <postscript> that made TeXmacs
crash when you entered something like <postscript|foo.eps|123|456|||||>.

Then I remembered I also want <postscript> to be able to evaluate its
parameters. But for this to be really useful, you need to be able to do more
advanced arithmetic on lengths than just adding and substracting.
Multiplication, division, and comparison of lengths is useful sometimes.

In this course, I noticed that logical and conditional operators were sloppy
in their definition of what is an acceptable boolean value, and that <not>
was broken.

I also found a bug (missing sanity check) in <range>, that appeared when the
end of the range was before the beginning.

So I fixed and tested this all.

Now, <postscript> evaluates its parameters. Lengths can be multiplied by a
number with <*> and divided by a number or another length with </>.
Comparison operators <equal>, <unequal> behave correctly when they are given
lengths. <less>, <less-or-equal>, <greater>, <greater-or-equal> support
lengths. <or>, <and>, <if>, <case> and <while> are more strict on acceptable
boolean values, now they only accepted "true" and "false". <not> is no longer
broken. <range|...|0|-1> behave correctly. And all these elements do complete
and consistent checking on input validity.

All these modifications can break some documents, but only pathologic
documents that relied on loopholes of TeXmacs stylesheet language.

Attached is bzip compressed archive containing the patch and the TeXmacs
document containing the test set.

Merry christmas.

Attachment: patch-0.3.5.11.tar.bz2
Description: BZip2 compressed data



  • Patch: <postcript> and arithmetic logical and conditional markup, David Allouche, 12/24/2001

Archive powered by MHonArc 2.6.19.

Top of page