[metapost] what about allsuffixes operator?

Boguslaw Jackowski B_Jackowski at GUST.org.pl
Sat Mar 2 22:09:39 CET 2013


Hello, again,

MS:
> Not to derail your discussion,

To derail the discussion further, we would like to come up
with a proposal (it sprouts in our heads quite a long time)
of extending the functionality of Metapost by an
`allsuffixes' operator.

Let's explain the idea on a trivial example. Assume that we have
declared or used variables a.a, a.a.b, a.a.b.c; then the statement
    forsuffixes $:=allsuffixes a:
would succesively assign to $ the suffixes a, a.b, a.b.c,
and the statement
    forsuffixes $:=allsuffixes a.a:
would succesively assign to $ the suffixes b, b.c.

Perhaps the operation of the undefining of a variable
(i.e., deleting it, not to be confused with the assigning
of an undefined value to a variable) should consequently
accompany such and extension.

The generated sequence of suffixes could be perhaps
lexicographically ordered.

Note that such an operation actually is ("implicitly")
implemented in Metafont, and, thus, in Metapost.
The primitive `showvariable' does the job, with lexicographic
sorting. (There is not, however, the `delete' operation.)

Alas, since mpost 1.5*, `showvariable' does not work any longer.
For example, the simple program:

     a1=2; a2=3; showvariable a;

produces the following log for mpost 1.2:

    a[]=numeric
    a1=2
    a2=3

while mpost 1.5 (and later) emits an enigmatic message:

   a=tag

Is there a chance that the behaviour of `showvariable' will
improve some nice day?

Cheers -- Jacko & Piotr

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  Bogus\l{}aw Jackowski: B_Jackowski at GUST.ORG.PL
----------------------------------------------------------------
  Hofstadter's Law: It always takes longer than you expect, even
                    when you take into account Hofstadter's Law.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-




More information about the metapost mailing list