From - Mon Jan  1 07:21:44 2001
Return-Path: <Denis.Roegel@loria.fr>
Received: from lorraine.loria.fr (lorraine.loria.fr [152.81.1.17]) by
    nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f016LaM65694 for
    <metafont@ens.fr>; Mon, 1 Jan 2001 07:21:36 +0100 (CET)
Received: from lasaigne.loria.fr (lasaigne.loria.fr [152.81.2.101]) by
    lorraine.loria.fr (8.9.3/8.9.3/8.9.3/JCG-DG) with ESMTP id HAA28495;
    Mon, 1 Jan 2001 07:21:35 +0100 (MET)
From: "Denis B. Roegel" <Denis.Roegel@loria.fr>
Received: (from roegel@localhost) by lasaigne.loria.fr
    (8.9.3/8.9.3/8.9.3-client/JCG) id HAA13873; Mon, 1 Jan 2001 07:21:35 +0100
    (MET)
Date: Mon, 1 Jan 2001 07:21:35 +0100 (MET)
Message-Id: <200101010621.HAA13873@lasaigne.loria.fr>
To: metafont@nef.ens.fr
Cc: roegel@lorraine.loria.fr
X-Loop: metafont@nef.ens.fr
X-Sequence: 346
Precedence: list
Subject: [metafont] TeX/MetaPost poster of the U.S. elections in Florida


Hello and Happy New Millenium!

I have recently used TeX & MetaPost to make a large poster 
clarifying the lawsuits in the recent U.S. elections in 
Florida. You can find it at:

  http://www.loria.fr/~roegel/uselection2000/

There are three versions of the poster. The first two have been
made with the `poster' package of Tim Van Zandt, and the last
one was merely produced with pdflatex, after changing the pdf
dimensions to suitable values. The figure itself is rather 
elementary metapost code (boxes and lines).

Enjoy!

Denis Roegel

From - Tue Jan  2 18:52:22 2001
Return-Path: <pragma@wxs.nl>
Received: from smtp06.wxs.nl (smtp06.wxs.nl [195.121.6.58]) by nef.ens.fr
    (8.10.1/1.01.28121999) with ESMTP id f02HqEM62009 for <metafont@ens.fr>;
    Tue, 2 Jan 2001 18:52:14 +0100 (CET)
Received: from laptop-1 ([195.121.140.241]) by smtp06.wxs.nl (Netscape
    Messaging Server 4.05) with SMTP id G6JQZ003.3B2; Tue, 2 Jan 2001 18:52:12
    +0100
Message-Id: <3.0.6.32.20010102184008.01513910@pop.wxs.nl>
X-Sender: pragma@pop.wxs.nl
X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.6 (32)
Date: Tue, 02 Jan 2001 18:40:08 +0100
To: Boguslaw Jackowski <B.Jackowski@GUST.org.pl>
From: Hans Hagen <pragma@wxs.nl>
Subject: Re: [metafont] perhaps the last MP bug in this millennium...
Cc: The Discussion List of METAFONT/METAPOST <metafont@nef.ens.fr>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
X-Loop: metafont@nef.ens.fr
X-Sequence: 347
Precedence: list

At 07:57 PM 12/30/00 +0100, Boguslaw Jackowski wrote:

>Surprisingly, the bug was observed only if the origin of the path
>was the top point of the curve and when the orientation is clockwise,
>but I cannot swear that this is the rule.

There is certainly a pattern but it seems to be violated. I send you a test
file in a separate mail. 

>Incidentally, there was literary no response to my bug report
>from 4 Jun 2000 (subject: four buglets -- a report).
>I'd be obliged if somebody could verify whether I haven't
>written rubbish...

Can you send me the mail? 

Hans
-------------------------------------------------------------------------
                                                  Hans Hagen | PRAGMA ADE
                      Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


From - Fri Jan  5 10:35:40 2001
Return-Path: <pandr@pandr.dk>
Received: from pandr.dk ([194.234.58.168]) by nef.ens.fr
    (8.10.1/1.01.28121999) with ESMTP id f059ZWM94504 for <metafont@ens.fr>;
    Fri, 5 Jan 2001 10:35:33 +0100 (CET)
Received: (from pandr@localhost) by pandr.dk (8.11.0/8.11.0) id
    f059b1O08137 for metafont@ens.fr; Fri, 5 Jan 2001 10:37:01 +0100
Date: Fri, 5 Jan 2001 10:37:01 +0100
From: Peter Andreasen <pandr@pandr.dk>
To: metafont@nef.ens.fr
Message-Id: <20010105103701.A7912@pandr.dk>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.2.5i
X-Loop: metafont@nef.ens.fr
X-Sequence: 348
Precedence: list
Subject: [metafont] METAPOST, TAOCP and pretty trees

Hello everyone,

   I hope this is the right forum to ask. I am curious as to how Knuth
   did all the nice drawings of trees in TAOCP. I am thinking on the
   small, simple n-ary trees where nodes a drawn as circles with a label
   inside.

   I know just enough METAPOST to realize, that for drawing more than a
   single tree, you would definitely want to have some helpful macros.
   Do you know of a macro-collection that would help me do this? Do you
   know how Knuth's sources for the tree-figures look like?

All the best,

 - Peter

From - Fri Jan  5 10:59:38 2001
Return-Path: <robin.fairbairns@cl.cam.ac.uk>
Received: from wisbech.cl.cam.ac.uk (mta1.cl.cam.ac.uk [128.232.0.15]) by
    nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f059xVM96741 for
    <metafont@ens.fr>; Fri, 5 Jan 2001 10:59:31 +0100 (CET)
Received: from pallas.cl.cam.ac.uk ([128.232.8.88] helo=cl.cam.ac.uk
    ident=rf) by wisbech.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id
    14ETee-0002pu-00; Fri, 05 Jan 2001 09:59:24 +0000
To: Peter Andreasen <pandr@pandr.dk>
Cc: metafont@nef.ens.fr
Subject: Re: [metafont] METAPOST, TAOCP and pretty trees
In-Reply-To: Your message of
    "Fri, 05 Jan 2001 10:37:01 +0100." <20010105103701.A7912@pandr.dk>
Date: Fri, 05 Jan 2001 09:59:24 +0000
From: Robin Fairbairns <Robin.Fairbairns@cl.cam.ac.uk>
Message-Id: <E14ETee-0002pu-00@wisbech.cl.cam.ac.uk>
X-Loop: metafont@nef.ens.fr
X-Sequence: 349
Precedence: list

> Hello everyone,
> 
>    I hope this is the right forum to ask. I am curious as to how Knuth
>    did all the nice drawings of trees in TAOCP. I am thinking on the
>    small, simple n-ary trees where nodes a drawn as circles with a label
>    inside.

if you're talking about the new revised editions, the chances are that
he did do the diagrams in metapost.  when he was discussing taocp in
his talk at tug'95 (before any of the revised edition was published)
he said he does _all_ his diagrams using metapost, nowadays.

>    I know just enough METAPOST to realize, that for drawing more than a
>    single tree, you would definitely want to have some helpful macros.
>    Do you know of a macro-collection that would help me do this? Do you
>    know how Knuth's sources for the tree-figures look like?

he would probably be persuadable to let them into the public domain,
but it would quite likely take a lot of effort.  (iirc it was barbara
beeton persuaded him to let out the macros for the concrete maths book
at my suggestion, but it took an absolute age.)

From - Fri Jan  5 12:53:11 2001
Return-Path: <dongen@swift.ucc.ie>
Received: from interzone.ucc.ie (interzone.ucc.ie [143.239.1.134]) by
    nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f05Br4M07131 for
    <metafont@ens.fr>; Fri, 5 Jan 2001 12:53:04 +0100 (CET)
Received: from swift.ucc.ie (swift.ucc.ie [143.239.211.48]) by
    interzone.ucc.ie (8.9.3/8.9.3) with ESMTP id LAA29399; Fri, 5 Jan 2001
    11:53:14 GMT
Received: (from dongen@localhost) by swift.ucc.ie (8.9.3+Sun/8.9.3) id
    LAA10929; Fri, 5 Jan 2001 11:52:40 GMT
Date: Fri, 5 Jan 2001 11:52:40 +0000
From: Marc van Dongen <dongen@cs.ucc.ie>
To: Peter Andreasen <pandr@pandr.dk>
Cc: metafont@nef.ens.fr
Subject: Re: [metafont] METAPOST, TAOCP and pretty trees
Message-Id: <20010105115240.I6997@cs.ucc.ie>
References: <20010105103701.A7912@pandr.dk>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.2.5i
In-Reply-To: <20010105103701.A7912@pandr.dk>; from pandr@pandr.dk on Fri,
    Jan 05, 2001 at 10:37:01AM +0100
X-Loop: metafont@nef.ens.fr
X-Sequence: 350
Precedence: list

Peter Andreasen (pandr@pandr.dk) wrote:

[trees in metapost]

If you use boxes.mp it's not that difficult. I
drew some nice once myself lately. The only thing
you have to think about in advance is how to
position the nodes. If you need to draw many trees
you want to do this automatically. Otherwise do it
by hand.

If you know the parent and its siblings in a tree
you can draw their nodes and do a:

draw parent.c--sibling[i].c
     cutbefore bpath parent cutafter bpath sibling[i];

HTH.

Regards,

Marc

From - Fri Jan  5 17:10:16 2001
Return-Path: <Peter.Wilson@PSS.Boeing.com>
Received: from slb-smtpout-01.boeing.com (slb-smtpout-01.boeing.com
    [12.13.237.21]) by nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id
    f05GA8M29998 for <metafont@ens.fr>; Fri, 5 Jan 2001 17:10:08 +0100 (CET)
Received: from slb-av-01.boeing.com ([129.172.13.4]) by
    slb-smtpout-01.boeing.com (8.9.2/8.8.5-M2) with ESMTP id IAA06903 for
    <metafont@ens.fr>; Fri, 5 Jan 2001 08:10:02 -0800 (PST)
Received: from slb-hub-01.boeing.com (localhost [127.0.0.1]) by
    slb-av-01.boeing.com (8.9.3/8.9.2) with ESMTP id IAA26367 for
    <metafont@ens.fr>; Fri, 5 Jan 2001 08:09:58 -0800 (PST)
Received: from xch-pssbh-01.ca.boeing.com by slb-hub-01.boeing.com with
    ESMTP; Fri, 5 Jan 2001 08:09:48 -0800
Received: by xch-pssbh-01.ca.boeing.com with Internet Mail Service
    (5.5.2650.21) id <Y8H8QCT6>; Fri, 5 Jan 2001 08:09:47 -0800
Message-Id: <47A8359928094345874C94095F80C4439A5511@xch-rtn-02>
From: "Wilson, Peter R" <Peter.Wilson@PSS.Boeing.com>
To: metafont@nef.ens.fr, "'Peter Andreasen'" <pandr@pandr.dk>
Subject: RE: [metafont] METAPOST, TAOCP and pretty trees
Date: Fri, 5 Jan 2001 08:09:46 -0800
Mime-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)
Content-Type: text/plain
X-Loop: metafont@nef.ens.fr
X-Sequence: 351
Precedence: list

    The expressg MetaPost package from CTAN includes macros for drawing box-line-annotation diagrams. You might find this useful but you have to lay out the diagrams manually.

Peter W.

Dr. Peter R. Wilson
Boeing Commercial Airplane Group
PO Box 3707, MS 6H-AF, Seattle, WA 98124-2207
(Package delivery: 1600 Lind Ave. SW, Renton, WA 98055)
Tel: (425) 237-3506, Fax: (425) 237-3428
Email: peter.r.wilson@boeing.com
-------------------------------------------------------------------------------------------------------
Any opinions expressed above are strictly personal; they are not to be 
construed as representative of any company or organization.
-------------------------------------------------------------------------------------------------------
A theory has only the alternative of being right or wrong. A model has a
third possibility: it may be right but irrelevant.    -- Manfred Eigen

> ----------
> From: 	Peter Andreasen[SMTP:pandr@pandr.dk]
> Sent: 	Friday, January 05, 2001 1:37 AM
> To: 	metafont@ens.fr
> Subject: 	[metafont] METAPOST, TAOCP and pretty trees
> 
> Hello everyone,
> 
>    I hope this is the right forum to ask. I am curious as to how Knuth
>    did all the nice drawings of trees in TAOCP. I am thinking on the
>    small, simple n-ary trees where nodes a drawn as circles with a label
>    inside.
> 
>    I know just enough METAPOST to realize, that for drawing more than a
>    single tree, you would definitely want to have some helpful macros.
>    Do you know of a macro-collection that would help me do this? Do you
>    know how Knuth's sources for the tree-figures look like?
> 
> All the best,
> 
>  - Peter
> 

From - Sat Jan  6 01:57:56 2001
Return-Path: <JGMBenoit@Wanadoo.fr>
Received: from antholoma.wanadoo.fr (smtp-abo-4.wanadoo.fr
    [193.252.19.153]) by nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id
    f060vkM64905 for <metafont@ens.fr>; Sat, 6 Jan 2001 01:57:46 +0100 (CET)
Received: from wanadoo.fr (164.138.179.139) by antholoma.wanadoo.fr;
    6 Jan 2001 01:57:46 +0100
Message-Id: <3A566CB2.BFF8D389@Wanadoo.fr>
Date: Sat, 06 Jan 2001 01:54:10 +0100
From: Jerome BENOIT <JGMBenoit@Wanadoo.fr>
X-Mailer: Mozilla 4.76 [en] (Win98; U)
X-Accept-Language: en
Mime-Version: 1.0
To: MetaPost <metafont@nef.ens.fr>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Loop: metafont@nef.ens.fr
X-Sequence: 352
Precedence: list
Subject: [metafont] MP: write18 feature

Bonjour:

Is there a TeX like `\write18' feature for MetaPost ?

Thanks in advance,
Jerome BENOIT


From - Mon Jan  8 11:23:48 2001
Return-Path: <pragma@wxs.nl>
Received: from smtp9.xs4all.nl (smtp9.xs4all.nl [194.109.127.135]) by
    nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f08ANcM22121 for
    <metafont@ens.fr>; Mon, 8 Jan 2001 11:23:38 +0100 (CET)
Received: from server-1.pragma-ade.nl (s340-isdn1540.dial.xs4all.nl
    [194.109.186.4]) by smtp9.xs4all.nl (8.9.3/8.9.3) with ESMTP id AAA20292;
    Mon, 8 Jan 2001 00:36:24 +0100 (CET)
Received: from laptop-1 ([200.1.1.42]) by server-1.pragma-ade.nl
    (8.9.3/8.9.3) with SMTP id AAA12149; Mon, 8 Jan 2001 00:32:21 +0100
Message-Id: <3.0.6.32.20010107234213.01aefbf0@200.1.1.1>
X-Sender: hagen@200.1.1.1
X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.6 (32)
Date: Sun, 07 Jan 2001 23:42:13 +0100
To: Jerome BENOIT <JGMBenoit@Wanadoo.fr>
From: Hans Hagen <pragma@wxs.nl>
Subject: Re: [metafont] MP: write18 feature
Cc: MetaPost <metafont@nef.ens.fr>
In-Reply-To: <3A566CB2.BFF8D389@Wanadoo.fr>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
X-Loop: metafont@nef.ens.fr
X-Sequence: 353
Precedence: list

At 01:54 AM 1/6/01 +0100, Jerome BENOIT wrote:
>Bonjour:
>
>Is there a TeX like `\write18' feature for MetaPost ?

No. What effect do you want to achieve? Maybe there's another way. 

In MetaPost, specials and writing is not like in tex, where it is part of
the datastream and remains there until flushed. In mp, specials and writes
are immediate. 

This also means that you cannot use specials and writes like you do in tex.
This is not to say that they cannot be used -) For instance, i've
implemented ps level 2 shading and bitmap/vector graphic inclusion in mp
using specials, and outline fonts and alike using writes. But, you have to
apply a some trickery to get things synchronized. 

This is definitely an area that is under investigation by those who are
discussing mp extensions but quite some experiments are needed to get
things clear -) 

Hans   

 
-------------------------------------------------------------------------
                                                  Hans Hagen | PRAGMA ADE
                      Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


From - Tue Jan  9 08:47:23 2001
Return-Path: <pandr@pandr.dk>
Received: from pandr.dk ([194.234.58.168]) by nef.ens.fr
    (8.10.1/1.01.28121999) with ESMTP id f097lGM28849 for <metafont@ens.fr>;
    Tue, 9 Jan 2001 08:47:16 +0100 (CET)
Received: (from pandr@localhost) by pandr.dk (8.11.0/8.11.0) id
    f097oje15172 for metafont@ens.fr; Tue, 9 Jan 2001 08:50:45 +0100
Date: Tue, 9 Jan 2001 08:50:45 +0100
From: Peter Andreasen <pandr@pandr.dk>
To: metafont@nef.ens.fr
Subject: Re: [metafont] METAPOST, TAOCP and pretty trees
Message-Id: <20010109085045.B15139@pandr.dk>
References: <47A8359928094345874C94095F80C4439A5511@xch-rtn-02>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.2.5i
In-Reply-To: <47A8359928094345874C94095F80C4439A5511@xch-rtn-02>;
    from Peter.Wilson@PSS.Boeing.com on Fri, Jan 05, 2001 at 08:09:46AM -0800
X-Loop: metafont@nef.ens.fr
X-Sequence: 354
Precedence: list

Hi,

  First, thanks a lot for all the great answers to my question. I have
  looked a bit around and I ended up doing-it-myself with a bunch of
  MP macros. This is probably not the best way to do things, but it
  solved my problem and allowed me to move on with my thesis.

  If someone out there is bored enough to want to look at my scriblings
  of MP code, the snip is below. Go ahead, tear it apart :-)

All the best,

 - Peter

[ METAPOST CODE BELOW ]

% ----------------------------------------------------------------------------

prologues:=2;

% ----------------------------------------------------------------------------

u=1cm;

% ----------------------------------------------------------------------------

newinternal circsize;

circsize:=0.5u;

def initnodes = 
  begingroup
    pair nds[].c;
    path nds[].p;
    picture nds[].t;
  endgroup
enddef;

def node(expr num, pos, tt) =
  begingroup
    nds[num].c = u*pos;
    nds[num].p = fullcircle scaled circsize shifted (u*pos);
    nds[num].t = tt;
  endgroup
enddef;

def drawnode(expr num) =
  begingroup
    draw nds[num].p;
    draw nds[num].t shifted (nds[num].c - 0.5[llcorner nds[num].t, urcorner nds[num].t]);
  endgroup
enddef;

def drawedge(expr n, m) =
  begingroup
    draw nds[n].c .. nds[m].c cutbefore nds[n].p cutafter nds[m].p;
  endgroup
enddef;

def drawnodes(text t) =
	forsuffixes s=t: drawnode(s); endfor
enddef;

def draw_circ(expr pos, lab) =
  begingroup
     draw fullcircle scaled 0.5u shifted (u*pos);
     draw lab shifted (u*pos - 0.5[llcorner lab, urcorner lab]);
  endgroup;
enddef;

% ----------------------------------------------------------------------------

beginfig(1);
initnodes;
node(1, (10,10), btex A etex );
	node(2, (8,9), btex B etex );
	node(3, (12,9), btex C etex );
		node( 4, (10.5,8), btex D etex );
			node( 6, (9.5,7), btex F etex );
			node( 7, (11.5,7), btex G etex );
				node(10, (11,6), btex J etex );
				node(11, (12,6), btex K etex );
		node( 5, (13.5,8), btex E etex );
			node( 8, (12.5,7), btex H etex );
			node( 9, (14.5,7), btex I etex );
				node(12, (15,6), btex L etex );
drawnodes(1,2,3,4,5,6,7,8,9,10,11,12);
drawedge(1,2);
drawedge(1,3);
drawedge(3,4);
drawedge(3,5);
drawedge(4,6);
drawedge(4,7);
drawedge(5,8);
drawedge(5,9);
drawedge(7,10);
drawedge(7,11);
drawedge(9,12);
label.urt(btex $1$ etex, 0.5[nds[3].c,nds[1].c]);
label.ulft(btex $0$ etex, 0.5[nds[1].c,nds[2].c]);
endfig;
% ----------------------------------------------------------------------------
end

From - Fri Jan 12 00:34:15 2001
Return-Path: <Denis.Roegel@loria.fr>
Received: from lorraine.loria.fr (lorraine.loria.fr [152.81.1.17]) by
    nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f0BNY6M34098 for
    <metafont@ens.fr>; Fri, 12 Jan 2001 00:34:06 +0100 (CET)
Received: from bar.loria.fr (bar.loria.fr [152.81.2.13]) by
    lorraine.loria.fr (8.9.3/8.9.3/8.9.3/JCG-DG) with ESMTP id AAA16897;
    Fri, 12 Jan 2001 00:34:05 +0100 (MET)
From: "Denis B. Roegel" <Denis.Roegel@loria.fr>
Received: (from roegel@localhost) by bar.loria.fr
    (8.9.3/8.9.3/8.9.3-client/JCG) id AAA05221; Fri, 12 Jan 2001 00:34:05
    +0100 (MET)
Message-Id: <200101112334.AAA05221@bar.loria.fr>
To: metafont@nef.ens.fr
Date: Fri, 12 Jan 2001 00:34:05 +0100 (MET)
Cc: roegel@lorraine.loria.fr (Denis B. Roegel)
X-Mailer: ELM [version 2.5 PL2]
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Loop: metafont@nef.ens.fr
X-Sequence: 355
Precedence: list
Subject: [metafont] metapost: parentheses problem

Hello,

When I have a macro

def a(text t)=
 ...
  forsuffixes $=t: ...
  endfor;
  ...
enddef;

(the text parameter is a list of 2 or more numbers)

and I call it with

  i:=1;
  a(i,i+4)

I get an error, because metapost puts parentheses around the
value of i: it becomes

  a((1),(1)+4)

and the pattern matching fails with the text parameter.

My question is whether there is an easy way around this problem,
but by keeping the same interface. I don't want to give the argument
of a as a string, just as a list separated by commas.
Is the previous problem impossible to solve?

Thanks for any ideas!

Denis


From - Fri Jan 12 16:31:52 2001
Return-Path: <henkel@vh-s.de>
Received: from mailout00.sul.t-online.com (mailout00.sul.t-online.com
    [194.25.134.16]) by nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id
    f0CFVfM03664 for <metafont@ens.fr>; Fri, 12 Jan 2001 16:31:41 +0100 (CET)
Received: from fwd01.sul.t-online.com by mailout00.sul.t-online.com with
    smtp id 14H6Ay-0002dg-02; Fri, 12 Jan 2001 16:31:36 +0100
Received: from vhssv1.vhs (320016211760-0001@[62.158.0.110]) by
    fmrl01.sul.t-online.com with esmtp id 14H6At-1Mbq0OC; Fri, 12 Jan 2001
    16:31:31 +0100
Received: from hahepc.vhs (mail@hahepc.vhs [192.168.0.3]) by vhssv1.vhs
    (8.8.8/8.8.8) with ESMTP id QAA20449; Fri, 12 Jan 2001 16:31:25 +0100
Received: from hahe (helo=localhost) by hahepc.vhs with local-esmtp (Exim
    3.12 #1 (Debian)) id 14H6As-0006jm-00; Fri, 12 Jan 2001 16:31:30 +0100
Date: Fri, 12 Jan 2001 16:31:30 +0100 (CET)
From: Hartmut Henkel <henkel@vh-s.de>
To: "Denis B. Roegel" <Denis.Roegel@loria.fr>
Cc: Metafont List <metafont@nef.ens.fr>
Subject: [metafont] Re: metapost: parentheses problem
In-Reply-To: <200101112334.AAA05221@bar.loria.fr>
Message-Id: <Pine.LNX.4.21.0101121626310.24489-100000@hahepc.vhs>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Sender: 320016211760-0001@t-dialin.net
X-Loop: metafont@nef.ens.fr
X-Sequence: 356
Precedence: list

Hi,

replacing `forsuffixes' by `for' might help, see the example:

beginfig(1)

def a(text t)=
  for $=t:
  show $; % here we have the result
  endfor;
enddef;

i:=1;
a(i,i+1,i+2);

endfig
end

This gives:

This is MetaPost, Version 0.641 (Web2C 7.3.1)
(x.mp
>> 1
>> 2
>> 3 [1] )

Greetings Hartmut


On Fri, 12 Jan 2001, Denis B. Roegel wrote:

> Hello,
> 
> When I have a macro
> 
> def a(text t)=
>  ...
>   forsuffixes $=t: ...
>   endfor;
>   ...
> enddef;
> 
> (the text parameter is a list of 2 or more numbers)
> 
> and I call it with
> 
>   i:=1;
>   a(i,i+4)
> 
> I get an error, because metapost puts parentheses around the
> value of i: it becomes
> 
>   a((1),(1)+4)
> 
> and the pattern matching fails with the text parameter.
> 
> My question is whether there is an easy way around this problem,
> but by keeping the same interface. I don't want to give the argument
> of a as a string, just as a list separated by commas.
> Is the previous problem impossible to solve?
> 
> Thanks for any ideas!
> 
> Denis


------------------------------------------------------------------------
Dr.-Ing. Hartmut Henkel
von Hoerner & Sulger GmbH
Schlossplatz 8
D-68723 Schwetzingen, Germany
E-Mail henkel@vh-s.de       Weiner's Law of Libraries:
WWW http://www.vh-s.de      There are no answers, only cross references.
------------------------------------------------------------------------


From - Fri Jan 12 21:59:04 2001
Return-Path: <luecking@uark.edu>
Received: from mail.uark.edu (mail.uark.edu [130.184.5.107]) by nef.ens.fr
    (8.10.1/1.01.28121999) with ESMTP id f0CKwsM31452 for <metafont@ens.fr>;
    Fri, 12 Jan 2001 21:58:54 +0100 (CET)
Received: from comp.uark.edu ([130.184.5.197]) by mail.uark.edu (Netscape
    Messaging Server 4.15) with ESMTP id G72IA403.B9Z; Fri, 12 Jan 2001
    14:58:52 -0600
Received: (from luecking@localhost) by comp.uark.edu (8.10.2/8.10.2) id
    f0CKwqp24101; Fri, 12 Jan 2001 14:58:52 -0600 (CST)
Date: Fri, 12 Jan 2001 14:58:52 -0600 (CST)
From: "Daniel Luecking" <luecking@uark.edu>
To: "Denis B. Roegel" <Denis.Roegel@loria.fr>
Cc: metafont@nef.ens.fr, "Denis B. Roegel" <roegel@lorraine.loria.fr>
Subject: Re: [metafont] metapost: parentheses problem
In-Reply-To: <200101112334.AAA05221@bar.loria.fr>
Message-Id: <Pine.SOL.4.10.10101121449430.22260-100000@comp.uark.edu>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Loop: metafont@nef.ens.fr
X-Sequence: 357
Precedence: list

On Fri, 12 Jan 2001, Denis B. Roegel wrote:

> Hello,
> 
> When I have a macro
> 
> def a(text t)=
>  ...
>   forsuffixes $=t: ...
>   endfor;
>   ...
> enddef;
> 
> (the text parameter is a list of 2 or more numbers)
> 
> and I call it with
> 
>   i:=1;
>   a(i,i+4)

i+4 is not a suffix. (MP does not evaluate text parameters.) To use a
numerical expression as a suffix you need to enclose it in braces. You
could use a(i,[i+4]) (at least that worked for me with a simple test).

You could also, as already suggested, use for instead of forsuffixes and
apply the braces around $ in the body of the for loop.

> 
> I get an error, because metapost puts parentheses around the
> value of i: it becomes
> 
>   a((1),(1)+4)
> 
> and the pattern matching fails with the text parameter.
> 

I think actually this occurs later, after expanding a(i,i+1) and trying 
to execute the forsuffixes.


-- 
Dan Luecking                           Dept. of Mathematical Sciences     
luecking@comp.uark.edu                 University of Arkansas      
http://comp.uark.edu/~luecking/        Fayetteville, AR 72101


From - Fri Jan 12 22:41:35 2001
Return-Path: <Denis.Roegel@loria.fr>
Received: from lorraine.loria.fr (lorraine.loria.fr [152.81.1.17]) by
    nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f0CLfSM33822 for
    <metafont@ens.fr>; Fri, 12 Jan 2001 22:41:28 +0100 (CET)
Received: from bar.loria.fr (bar.loria.fr [152.81.2.13]) by
    lorraine.loria.fr (8.9.3/8.9.3/8.9.3/JCG-DG) with ESMTP id WAA23406;
    Fri, 12 Jan 2001 22:41:28 +0100 (MET)
From: "Denis B. Roegel" <Denis.Roegel@loria.fr>
Received: (from roegel@localhost) by bar.loria.fr
    (8.9.3/8.9.3/8.9.3-client/JCG) id WAA21283; Fri, 12 Jan 2001 22:41:27
    +0100 (MET)
Message-Id: <200101122141.WAA21283@bar.loria.fr>
Subject: Re: [metafont] metapost: parentheses problem
To: luecking@uark.edu (Daniel Luecking)
Date: Fri, 12 Jan 2001 22:41:27 +0100 (MET)
Cc: Denis.Roegel@loria.fr (Denis B. Roegel), metafont@nef.ens.fr,
    roegel@lorraine.loria.fr (Denis B. Roegel)
In-Reply-To: <Pine.SOL.4.10.10101121449430.22260-100000@comp.uark.edu>
    from
    "Daniel Luecking" at Jan 12, 2001 02:58:52 PM
X-Mailer: ELM [version 2.5 PL2]
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Loop: metafont@nef.ens.fr
X-Sequence: 358
Precedence: list

`Daniel Luecking' wrote
>   
>   On Fri, 12 Jan 2001, Denis B. Roegel wrote:

>   > and I call it with
>   > 
>   >   i:=1;
>   >   a(i,i+4)
>   
>   i+4 is not a suffix. (MP does not evaluate text parameters.) To use a
>   numerical expression as a suffix you need to enclose it in braces. You
>   could use a(i,[i+4]) (at least that worked for me with a simple test).

Ok, but it is cumbersome.

>   >   a((1),(1)+4)
>   > 
>   > and the pattern matching fails with the text parameter.
>   > 
>   
>   I think actually this occurs later, after expanding a(i,i+1) and trying 
>   to execute the forsuffixes.

You are right.

So, the best solution was just to use for instead of forsuffixes
in this case.

Isn't it amazing? Sometimes you think that there is no solution
to a problem, and then there is something that simple!

Many thanks!

Denis

From - Sat Jan 13 12:20:24 2001
Return-Path: <smidi@gmx.at>
Received: from smtp1.utaiop.at (mx2.utanet.at [195.70.253.46]) by
    nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f0DBKGM72643 for
    <metafont@ens.fr>; Sat, 13 Jan 2001 12:20:16 +0100 (CET)
Received: from multi2.utaiop.at ([10.1.1.196]) by smtp1.utaiop.at
    (Netscape Messaging Server 4.15) with ESMTP id G73M5H01.0M6 for
    <metafont@ens.fr>; Sat, 13 Jan 2001 12:20:05 +0100
Received: from gmx.at ([212.152.210.198]) by multi2.utaiop.at (Netscape
    Messaging Server 4.15) with ESMTP id G73M5G01.V6V for <metafont@ens.fr>;
    Sat, 13 Jan 2001 12:20:04 +0100
Message-Id: <3A602C24.2096D132@gmx.at>
Date: Sat, 13 Jan 2001 11:21:24 +0100
From: Roland Smiderkal <smidi@gmx.at>
X-Mailer: Mozilla 4.7 [de] (Win98; I)
X-Accept-Language: de
Mime-Version: 1.0
To: metafont@nef.ens.fr
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Loop: metafont@nef.ens.fr
X-Sequence: 359
Precedence: list
Subject: [metafont] Passing macros as an argument?

Is it possible to pass (references to) macros as an argument to other
macros?

Roland Smiderkal


From - Sun Jan 14 09:36:37 2001
Return-Path: <luecking@uark.edu>
Received: from mail.uark.edu (mail.uark.edu [130.184.5.107]) by nef.ens.fr
    (8.10.1/1.01.28121999) with ESMTP id f0E8aSv10677 for <metafont@ens.fr>;
    Sun, 14 Jan 2001 09:36:28 +0100 (CET)
Received: from comp.uark.edu ([130.184.5.197]) by mail.uark.edu (Netscape
    Messaging Server 4.15) with ESMTP id G7511N00.74F; Sat, 13 Jan 2001
    23:39:23 -0600
Received: (from luecking@localhost) by comp.uark.edu (8.10.2/8.10.2) id
    f0E5dNX24995; Sat, 13 Jan 2001 23:39:23 -0600 (CST)
Date: Sat, 13 Jan 2001 23:39:23 -0600 (CST)
From: "Daniel Luecking" <luecking@uark.edu>
To: Roland Smiderkal <smidi@gmx.at>
Cc: metafont@nef.ens.fr
Subject: Re: [metafont] Passing macros as an argument?
In-Reply-To: <3A602C24.2096D132@gmx.at>
Message-Id: <Pine.SOL.4.10.10101132329010.24747-100000@comp.uark.edu>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Loop: metafont@nef.ens.fr
X-Sequence: 360
Precedence: list

On Sat, 13 Jan 2001, Roland Smiderkal wrote:

> Is it possible to pass (references to) macros as an argument to other
> macros?

Yes. If the argument is listed as type suffix or text. Example:
def apply (text f) (expr x) =
  f(x)
enddef;

def sinr (expr theta) = % sin with argument in radians
  sind(theta*180/3.1416)
enddef;

y := apply(sinr, 1.5708);
show y;


-- 
Dan Luecking                           Dept. of Mathematical Sciences     
luecking@comp.uark.edu                 University of Arkansas      
http://comp.uark.edu/~luecking/        Fayetteville, AR 72101


From - Sun Jan 14 21:54:39 2001
Return-Path: <smidi@gmx.at>
Received: from smtp1.utaiop.at (mx2.utanet.at [195.70.253.46]) by
    nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f0EKsTv47133 for
    <metafont@ens.fr>; Sun, 14 Jan 2001 21:54:29 +0100 (CET)
Received: from multi2.utaiop.at ([10.1.1.196]) by smtp1.utaiop.at
    (Netscape Messaging Server 4.15) with ESMTP id G767ES02.Q17 for
    <metafont@ens.fr>; Sun, 14 Jan 2001 21:54:28 +0100
Received: from gmx.at ([212.152.205.170]) by multi2.utaiop.at (Netscape
    Messaging Server 4.15) with ESMTP id G767ER01.ACV for <metafont@ens.fr>;
    Sun, 14 Jan 2001 21:54:27 +0100
Message-Id: <3A6211F7.966E567D@gmx.at>
Date: Sun, 14 Jan 2001 21:54:15 +0100
From: Roland Smiderkal <smidi@gmx.at>
X-Mailer: Mozilla 4.7 [de] (Win98; I)
X-Accept-Language: de
Mime-Version: 1.0
To: metafont@nef.ens.fr
Subject: Re: [metafont] Passing macros as an argument?
References: <Pine.SOL.4.10.10101132329010.24747-100000@comp.uark.edu>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Loop: metafont@nef.ens.fr
X-Sequence: 361
Precedence: list

Daniel Luecking wrote:

> Yes. If the argument is listed as type suffix or text. Example:
> def apply (text f) (expr x) =
>   f(x)
> enddef;
> 
> def sinr (expr theta) = % sin with argument in radians
>   sind(theta*180/3.1416)
> enddef;
> 
> y := apply(sinr, 1.5708);
> show y;

Thank you, it works. The only thing is, that one has to use

  apply(sinr)(1.5708);

instead of

  apply(sinr, 1.5708);

Now I begin to understand what text and suffix parameter are for (the
explanations in the metapost manual and the metafont book actualy
confused me).

Roland Smiderkal

From - Sun Jan 14 21:56:29 2001
Return-Path: <smidi@gmx.at>
Received: from smtp1.utaiop.at (mx2.utanet.at [195.70.253.46]) by
    nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f0EKuJv47254 for
    <metafont@ens.fr>; Sun, 14 Jan 2001 21:56:20 +0100 (CET)
Received: from multi1.utaiop.at ([10.1.1.195]) by smtp1.utaiop.at
    (Netscape Messaging Server 4.15) with ESMTP id G767HV01.10V for
    <metafont@ens.fr>; Sun, 14 Jan 2001 21:56:19 +0100
Received: from gmx.at ([212.152.205.170]) by multi1.utaiop.at (Netscape
    Messaging Server 4.15) with ESMTP id G767HU00.UCK for <metafont@ens.fr>;
    Sun, 14 Jan 2001 21:56:18 +0100
Message-Id: <3A621267.2829345B@gmx.at>
Date: Sun, 14 Jan 2001 21:56:07 +0100
From: Roland Smiderkal <smidi@gmx.at>
X-Mailer: Mozilla 4.7 [de] (Win98; I)
X-Accept-Language: de
Mime-Version: 1.0
To: metafont@nef.ens.fr
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Loop: metafont@nef.ens.fr
X-Sequence: 362
Precedence: list
Subject: [metafont] How to determine the length of a string?

Is there a way in MetaPost to determine the length of a string?

Roland Smiderkal

From - Sun Jan 14 23:36:57 2001
Return-Path: <Denis.Roegel@loria.fr>
Received: from lorraine.loria.fr (lorraine.loria.fr [152.81.1.17]) by
    nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f0EMapv52771 for
    <metafont@ens.fr>; Sun, 14 Jan 2001 23:36:51 +0100 (CET)
Received: from bar.loria.fr (bar.loria.fr [152.81.2.13]) by
    lorraine.loria.fr (8.9.3/8.9.3/8.9.3/JCG-DG) with ESMTP id XAA25156;
    Sun, 14 Jan 2001 23:36:50 +0100 (MET)
From: "Denis B. Roegel" <Denis.Roegel@loria.fr>
Received: (from roegel@localhost) by bar.loria.fr
    (8.9.3/8.9.3/8.9.3-client/JCG) id XAA09591; Sun, 14 Jan 2001 23:36:49
    +0100 (MET)
Message-Id: <200101142236.XAA09591@bar.loria.fr>
To: metafont@nef.ens.fr
Date: Sun, 14 Jan 2001 23:36:49 +0100 (MET)
Cc: roegel@lorraine.loria.fr (Denis B. Roegel)
X-Mailer: ELM [version 2.5 PL2]
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Loop: metafont@nef.ens.fr
X-Sequence: 363
Precedence: list
Subject: [metafont] is it possible to refreshen a variable?

Assume I have

  z1-z0=(1cm,0);

and that later I want to change that, with the same variables,
but such that

  z1-z0=v;

where v is a certain pair. I don't want z1 and z0 to be defined,
only replace an equation by another one. It may seem strange,
but there are cases where this is useful, for instance if you want
to rotate a partially defined object.

Is this possible in metafont/metapost?

Thanks!

Denis

From - Sun Jan 14 23:38:48 2001
Return-Path: <Denis.Roegel@loria.fr>
Received: from lorraine.loria.fr (lorraine.loria.fr [152.81.1.17]) by
    nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f0EMccv52841 for
    <metafont@ens.fr>; Sun, 14 Jan 2001 23:38:38 +0100 (CET)
Received: from bar.loria.fr (bar.loria.fr [152.81.2.13]) by
    lorraine.loria.fr (8.9.3/8.9.3/8.9.3/JCG-DG) with ESMTP id XAA25218;
    Sun, 14 Jan 2001 23:38:38 +0100 (MET)
From: "Denis B. Roegel" <Denis.Roegel@loria.fr>
Received: (from roegel@localhost) by bar.loria.fr
    (8.9.3/8.9.3/8.9.3-client/JCG) id XAA09599; Sun, 14 Jan 2001 23:38:37
    +0100 (MET)
Message-Id: <200101142238.XAA09599@bar.loria.fr>
Subject: Re: [metafont] Passing macros as an argument?
To: smidi@gmx.at (Roland Smiderkal)
Date: Sun, 14 Jan 2001 23:38:37 +0100 (MET)
Cc: metafont@nef.ens.fr
In-Reply-To: <3A6211F7.966E567D@gmx.at> from
    "Roland Smiderkal" at Jan 14, 2001 09:54:15 PM
X-Mailer: ELM [version 2.5 PL2]
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Loop: metafont@nef.ens.fr
X-Sequence: 364
Precedence: list

`Roland Smiderkal' wrote
>   
>   Thank you, it works. The only thing is, that one has to use
>   
>     apply(sinr)(1.5708);

Sometimes, it's also useful to pass the name as a string,
in case you want to construct something from that string.
You can then use scantokens to reach the function.

Denis

From - Sun Jan 14 23:54:56 2001
Return-Path: <Denis.Roegel@loria.fr>
Received: from lorraine.loria.fr (lorraine.loria.fr [152.81.1.17]) by
    nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f0EMsmv53909 for
    <metafont@ens.fr>; Sun, 14 Jan 2001 23:54:48 +0100 (CET)
Received: from bar.loria.fr (bar.loria.fr [152.81.2.13]) by
    lorraine.loria.fr (8.9.3/8.9.3/8.9.3/JCG-DG) with ESMTP id XAA25595;
    Sun, 14 Jan 2001 23:54:47 +0100 (MET)
From: "Denis B. Roegel" <Denis.Roegel@loria.fr>
Received: (from roegel@localhost) by bar.loria.fr
    (8.9.3/8.9.3/8.9.3-client/JCG) id XAA09637; Sun, 14 Jan 2001 23:54:47
    +0100 (MET)
Message-Id: <200101142254.XAA09637@bar.loria.fr>
Subject: Re: [metafont] is it possible to refreshen a variable?
To: Denis.Roegel@loria.fr (Denis B. Roegel)
Date: Sun, 14 Jan 2001 23:54:47 +0100 (MET)
Cc: metafont@nef.ens.fr, roegel@lorraine.loria.fr (Denis B. Roegel)
In-Reply-To: <200101142236.XAA09591@bar.loria.fr> from
    "Denis B. Roegel" at Jan 14, 2001 11:36:49 PM
X-Mailer: ELM [version 2.5 PL2]
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Loop: metafont@nef.ens.fr
X-Sequence: 365
Precedence: list

`Denis B. Roegel' wrote
>   
>   Assume I have
>   
>     z1-z0=(1cm,0);
>   
>   and that later I want to change that, with the same variables,
>   but such that
>   
>     z1-z0=v;
>   
>   where v is a certain pair. I don't want z1 and z0 to be defined,
>   only replace an equation by another one. It may seem strange,
>   but there are cases where this is useful, for instance if you want
>   to rotate a partially defined object.
>   
>   Is this possible in metafont/metapost?

Of course it is! "save" is the answer:

z1-z0=(1cm,0);

save z;pair z[];

z1-z0=(2cm,1cm);

----------

Denis


From - Mon Jan 15 09:31:06 2001
Return-Path: <B.Jackowski@gust.org.pl>
Received: from chronos.ipipan.gda.pl (chronos.ipipan.gda.pl
    [153.19.136.16]) by nef.ens.fr (8.10.1/1.01.28121999) with SMTP id
    f0F8Uwv82068 for <metafont@ens.fr>; Mon, 15 Jan 2001 09:30:59 +0100 (CET)
Received: (qmail 3270 invoked by uid 410); 15 Jan 2001 08:30:38 -0000
Date: Mon, 15 Jan 2001 09:30:38 +0100 (MET)
From: Boguslaw Jackowski <B.Jackowski@GUST.org.pl>
X-Sender: jacko@chronos.ipipan.gda.pl
To: The Discussion List of METAFONT/METAPOST <metafont@nef.ens.fr>
Subject: Re: [metafont] is it possible to refreshen a variable?
Message-Id: <Pine.LNX.4.21.0101150930150.3268-100000@chronos.ipipan.gda.pl>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Loop: metafont@nef.ens.fr
X-Sequence: 366
Precedence: list


Hello,

`Denis B. Roegel' asked:
>   Assume I have
>     z1-z0=(1cm,0);
>   and that later I want to change that, with the same variables,
>   but such that
>     z1-z0=v;
>   where v is a certain pair. I don't want z1 and z0 to be defined,
>   only replace an equation by another one. It may seem strange,
>   but there are cases where this is useful, for instance if you want
>   to rotate a partially defined object.
>   Is this possible in metafont/metapost?

... and answered:
> Of course it is! "save" is the answer:
> z1-z0=(1cm,0);
> save z;pair z[];
> z1-z0=(2cm,1cm);

This is not a solution that I'd reccomend. In METAFONT, `z' is cleverly
defined not without reason. Better would be:

  save x,y;

(There is a `clearxy' macro in plain that does the same).

This is still unsatisfactory answer, since `save' obliterates the contnents
of _all_ variables that begin with a given suffix, in this case variables x5,
y.max, etc. would disappear.

All in all, I'd suggest:
  x0:=whatever; y0:=whatever;
  x1:=whatever; y1:=whatever;

Cheers -- Jacko

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




From - Mon Jan 15 11:05:05 2001
Return-Path: <pragma@wxs.nl>
Received: from smtp3.xs4all.nl (smtp3.xs4all.nl [194.109.127.132]) by
    nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f0FA4uv95472 for
    <metafont@ens.fr>; Mon, 15 Jan 2001 11:04:56 +0100 (CET)
Received: from server-1.pragma-ade.nl (s340-isdn1496.dial.xs4all.nl
    [194.109.185.216]) by smtp3.xs4all.nl (8.9.3/8.9.3) with ESMTP id LAA01297;
    Mon, 15 Jan 2001 11:04:55 +0100 (CET)
Received: from laptop-1 (laptop-1.pragma-ade.nl [200.1.1.25]) by
    server-1.pragma-ade.nl (8.9.3/8.9.3) with SMTP id KAA02310; Mon,
    15 Jan 2001 10:48:09 +0100
Message-Id: <3.0.6.32.20010115002937.009996e0@server-1>
X-Sender: hagen@server-1
X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.6 (32)
Date: Mon, 15 Jan 2001 00:29:37 +0100
To: Roland Smiderkal <smidi@gmx.at>
From: Hans Hagen <pragma@wxs.nl>
Subject: Re: [metafont] How to determine the length of a string?
Cc: metafont@nef.ens.fr
In-Reply-To: <3A621267.2829345B@gmx.at>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
X-Loop: metafont@nef.ens.fr
X-Sequence: 367
Precedence: list

At 09:56 PM 1/14/01 +0100, Roland Smiderkal wrote:
>Is there a way in MetaPost to determine the length of a string?

l := length("some lengthy string") ; 

show length "it realy works that way" ;

Hans 
-------------------------------------------------------------------------
                                  Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                      Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


From - Mon Jan 15 11:05:10 2001
Return-Path: <pragma@wxs.nl>
Received: from smtp3.xs4all.nl (smtp3.xs4all.nl [194.109.127.132]) by
    nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f0FA4vv95476 for
    <metafont@ens.fr>; Mon, 15 Jan 2001 11:04:57 +0100 (CET)
Received: from server-1.pragma-ade.nl (s340-isdn1496.dial.xs4all.nl
    [194.109.185.216]) by smtp3.xs4all.nl (8.9.3/8.9.3) with ESMTP id LAA01303;
    Mon, 15 Jan 2001 11:04:56 +0100 (CET)
Received: from laptop-1 (laptop-1.pragma-ade.nl [200.1.1.25]) by
    server-1.pragma-ade.nl (8.9.3/8.9.3) with SMTP id KAA02309; Mon,
    15 Jan 2001 10:48:09 +0100
Message-Id: <3.0.6.32.20010115002751.00999280@server-1>
X-Sender: hagen@server-1
X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.6 (32)
Date: Mon, 15 Jan 2001 00:27:51 +0100
To: "Denis B. Roegel" <Denis.Roegel@loria.fr>
From: Hans Hagen <pragma@wxs.nl>
Subject: Re: [metafont] is it possible to refreshen a variable?
Cc: metafont@nef.ens.fr
In-Reply-To: <200101142236.XAA09591@bar.loria.fr>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
X-Loop: metafont@nef.ens.fr
X-Sequence: 368
Precedence: list

At 11:36 PM 1/14/01 +0100, Denis B. Roegel wrote:
>Assume I have
>
>  z1-z0=(1cm,0);
>
>and that later I want to change that, with the same variables,
>but such that
>
>  z1-z0=v;
>
>where v is a certain pair. I don't want z1 and z0 to be defined,
>only replace an equation by another one. It may seem strange,
>but there are cases where this is useful, for instance if you want
>to rotate a partially defined object.
>
>Is this possible in metafont/metapost?

You can clear all x,y pairs with clearxy which is actually "save x,y";
unfortunately you cannot say save x1, so you cannot make a macro clearz,
but i may be wrong. 

Hans
  
-------------------------------------------------------------------------
                                  Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                      Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


From - Mon Jan 15 11:10:56 2001
Return-Path: <pragma@wxs.nl>
Received: from smtp8.xs4all.nl (smtp8.xs4all.nl [194.109.127.134]) by
    nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f0FAAov96121 for
    <metafont@ens.fr>; Mon, 15 Jan 2001 11:10:50 +0100 (CET)
Received: from server-1.pragma-ade.nl (s340-isdn1496.dial.xs4all.nl
    [194.109.185.216]) by smtp8.xs4all.nl (8.9.3/8.9.3) with ESMTP id LAA26075;
    Mon, 15 Jan 2001 11:10:49 +0100 (CET)
Received: from laptop-1 (laptop-1.pragma-ade.nl [200.1.1.25]) by
    server-1.pragma-ade.nl (8.9.3/8.9.3) with SMTP id LAA02382; Mon,
    15 Jan 2001 11:05:46 +0100
Message-Id: <3.0.6.32.20010115002937.00997a60@server-1>
X-Sender: hagen@server-1 (Unverified)
X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.6 (32)
Date: Mon, 15 Jan 2001 00:29:37 +0100
To: Roland Smiderkal <smidi@gmx.at>
From: Hans Hagen <pragma@wxs.nl>
Subject: Re: [metafont] How to determine the length of a string?
Cc: metafont@nef.ens.fr
In-Reply-To: <3A621267.2829345B@gmx.at>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
X-Loop: metafont@nef.ens.fr
X-Sequence: 369
Precedence: list

At 09:56 PM 1/14/01 +0100, Roland Smiderkal wrote:
>Is there a way in MetaPost to determine the length of a string?

l := length("some lengthy string") ; 

show length "it realy works that way" ;

Hans 
-------------------------------------------------------------------------
                                  Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                      Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


From - Mon Jan 15 11:11:02 2001
Return-Path: <pragma@wxs.nl>
Received: from smtp8.xs4all.nl (smtp8.xs4all.nl [194.109.127.134]) by
    nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f0FAAqv96135 for
    <metafont@ens.fr>; Mon, 15 Jan 2001 11:10:52 +0100 (CET)
Received: from server-1.pragma-ade.nl (s340-isdn1496.dial.xs4all.nl
    [194.109.185.216]) by smtp8.xs4all.nl (8.9.3/8.9.3) with ESMTP id LAA26083;
    Mon, 15 Jan 2001 11:10:50 +0100 (CET)
Received: from laptop-1 (laptop-1.pragma-ade.nl [200.1.1.25]) by
    server-1.pragma-ade.nl (8.9.3/8.9.3) with SMTP id LAA02381; Mon,
    15 Jan 2001 11:05:46 +0100
Message-Id: <3.0.6.32.20010115002751.00997600@server-1>
X-Sender: hagen@server-1 (Unverified)
X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.6 (32)
Date: Mon, 15 Jan 2001 00:27:51 +0100
To: "Denis B. Roegel" <Denis.Roegel@loria.fr>
From: Hans Hagen <pragma@wxs.nl>
Subject: Re: [metafont] is it possible to refreshen a variable?
Cc: metafont@nef.ens.fr
In-Reply-To: <200101142236.XAA09591@bar.loria.fr>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
X-Loop: metafont@nef.ens.fr
X-Sequence: 370
Precedence: list

At 11:36 PM 1/14/01 +0100, Denis B. Roegel wrote:
>Assume I have
>
>  z1-z0=(1cm,0);
>
>and that later I want to change that, with the same variables,
>but such that
>
>  z1-z0=v;
>
>where v is a certain pair. I don't want z1 and z0 to be defined,
>only replace an equation by another one. It may seem strange,
>but there are cases where this is useful, for instance if you want
>to rotate a partially defined object.
>
>Is this possible in metafont/metapost?

You can clear all x,y pairs with clearxy which is actually "save x,y";
unfortunately you cannot say save x1, so you cannot make a macro clearz,
but i may be wrong. 

Hans
  
-------------------------------------------------------------------------
                                  Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                      Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


From - Mon Jan 15 11:11:07 2001
Return-Path: <pragma@wxs.nl>
Received: from smtp8.xs4all.nl (smtp8.xs4all.nl [194.109.127.134]) by
    nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f0FAAsv96151 for
    <metafont@ens.fr>; Mon, 15 Jan 2001 11:10:54 +0100 (CET)
Received: from server-1.pragma-ade.nl (s340-isdn1496.dial.xs4all.nl
    [194.109.185.216]) by smtp8.xs4all.nl (8.9.3/8.9.3) with ESMTP id LAA26094;
    Mon, 15 Jan 2001 11:10:52 +0100 (CET)
Received: from laptop-1 (laptop-1.pragma-ade.nl [200.1.1.25]) by
    server-1.pragma-ade.nl (8.9.3/8.9.3) with SMTP id LAA02376; Mon,
    15 Jan 2001 11:05:34 +0100
Message-Id: <3.0.6.32.20010115105006.00997a60@server-1>
X-Sender: hagen@server-1
X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.6 (32)
Date: Mon, 15 Jan 2001 10:50:06 +0100
To: "Denis B. Roegel" <Denis.Roegel@loria.fr>
From: Hans Hagen <pragma@wxs.nl>
Subject: Re: [metafont] is it possible to refreshen a variable?
Cc: Denis.Roegel@loria.fr (Denis B. Roegel), metafont@nef.ens.fr,
    roegel@lorraine.loria.fr (Denis B. Roegel)
In-Reply-To: <200101142254.XAA09637@bar.loria.fr>
References: <200101142236.XAA09591@bar.loria.fr>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
X-Loop: metafont@nef.ens.fr
X-Sequence: 371
Precedence: list

At 11:54 PM 1/14/01 +0100, Denis B. Roegel wrote:
>`Denis B. Roegel' wrote
>>   
>>   Assume I have
>>   
>>     z1-z0=(1cm,0);
>>   
>>   and that later I want to change that, with the same variables,
>>   but such that
>>   
>>     z1-z0=v;
>>   
>>   where v is a certain pair. I don't want z1 and z0 to be defined,
>>   only replace an equation by another one. It may seem strange,
>>   but there are cases where this is useful, for instance if you want
>>   to rotate a partially defined object.
>>   
>>   Is this possible in metafont/metapost?
>
>Of course it is! "save" is the answer:
>
>z1-z0=(1cm,0);
>
>save z;pair z[];
>
>z1-z0=(2cm,1cm);

The pair z [] is not needed since z is a macro expanding into a pair (x,y)
so you don't save z, but x,y and that is what clearxy does. This normally
happens at beginfig time, which is why you can reuse z made variables
ineach figure. 

Hans
-------------------------------------------------------------------------
                                  Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                      Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


From - Tue Jan 16 22:56:02 2001
Return-Path: <Denis.Roegel@loria.fr>
Received: from lorraine.loria.fr (lorraine.loria.fr [152.81.1.17]) by
    nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f0GLtpv89432 for
    <metafont@ens.fr>; Tue, 16 Jan 2001 22:55:51 +0100 (CET)
Received: from bar.loria.fr (bar.loria.fr [152.81.2.13]) by
    lorraine.loria.fr (8.9.3/8.9.3/8.9.3/JCG-DG) with ESMTP id WAA16167;
    Tue, 16 Jan 2001 22:55:46 +0100 (MET)
From: "Denis B. Roegel" <Denis.Roegel@loria.fr>
Received: (from roegel@localhost) by bar.loria.fr
    (8.9.3/8.9.3/8.9.3-client/JCG) id WAA25459; Tue, 16 Jan 2001 22:55:46
    +0100 (MET)
Message-Id: <200101162155.WAA25459@bar.loria.fr>
Subject: Re: [metafont] is it possible to refreshen a variable?
To: B.Jackowski@GUST.org.pl (Boguslaw Jackowski)
Date: Tue, 16 Jan 2001 22:55:46 +0100 (MET)
Cc: metafont@nef.ens.fr
In-Reply-To: <Pine.LNX.4.21.0101150930150.3268-100000@chronos.ipipan.gda.pl> from
    "Boguslaw Jackowski" at Jan 15, 2001 09:30:38 AM
X-Mailer: ELM [version 2.5 PL2]
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Loop: metafont@nef.ens.fr
X-Sequence: 372
Precedence: list

`Boguslaw Jackowski' wrote
>   
>   All in all, I'd suggest:
>     x0:=whatever; y0:=whatever;
>     x1:=whatever; y1:=whatever;

It's exactly what I need. And I am in awe when I contemplate
an assignment like ``x0:=whatever''!
I believe it was mentionned before here, or maybe it is in the mfbook.
Anyway, before you reminded me of that, I was about to rename
all my arrays by ``alphabetizing'' the indices. I am glad I didn't
have to do it! (It's of course not difficult to do what I had
in mind, but your solution is so much simpler.)

Many thanks,

Denis

From - Wed Jan 17 10:41:30 2001
Return-Path: <pragma@wxs.nl>
Received: from smtp8.xs4all.nl (smtp8.xs4all.nl [194.109.127.134]) by
    nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f0H9fLv33039 for
    <metafont@ens.fr>; Wed, 17 Jan 2001 10:41:21 +0100 (CET)
Received: from server-1.pragma-ade.nl (s340-isdn2229.dial.xs4all.nl
    [194.109.188.181]) by smtp8.xs4all.nl (8.9.3/8.9.3) with ESMTP id KAA00962;
    Wed, 17 Jan 2001 10:41:20 +0100 (CET)
Received: from laptop-1 (laptop-1.pragma-ade.nl [200.1.1.25]) by
    server-1.pragma-ade.nl (8.9.3/8.9.3) with SMTP id KAA11691; Wed,
    17 Jan 2001 10:35:24 +0100
Message-Id: <3.0.6.32.20010117101506.019c7da0@server-1>
X-Sender: hagen@server-1
X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.6 (32)
Date: Wed, 17 Jan 2001 10:15:06 +0100
To: "Denis B. Roegel" <Denis.Roegel@loria.fr>
From: Hans Hagen <pragma@wxs.nl>
Subject: Re: [metafont] is it possible to refreshen a variable?
Cc: B.Jackowski@GUST.org.pl (Boguslaw Jackowski), metafont@nef.ens.fr
In-Reply-To: <200101162155.WAA25459@bar.loria.fr>
References: <Pine.LNX.4.21.0101150930150.3268-100000@chronos.ipipan.gda.pl>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
X-Loop: metafont@nef.ens.fr
X-Sequence: 373
Precedence: list

At 10:55 PM 1/16/01 +0100, Denis B. Roegel wrote:
>`Boguslaw Jackowski' wrote
>>   
>>   All in all, I'd suggest:
>>     x0:=whatever; y0:=whatever;
>>     x1:=whatever; y1:=whatever;
>
>It's exactly what I need. And I am in awe when I contemplate
>an assignment like ``x0:=whatever''!
>I believe it was mentionned before here, or maybe it is in the mfbook.
>Anyway, before you reminded me of that, I was about to rename
>all my arrays by ``alphabetizing'' the indices. I am glad I didn't
>have to do it! (It's of course not difficult to do what I had
>in mind, but your solution is so much simpler.)
 
This is indeed an interesting solution. I guess it's a kind of undefining
operation. So, we can define a "clearz" macro as 

vardef clearz@# =
  x@# := whatever ;
  y@# := whatever ;
enddef ;

show x0 ; z0 = (10,10) ;
show x0 ; x0 := whatever ; y0 := whatever ;
show x0 ; z0 = (20,20) ;
show x0 ; clearz0 ;
show x0 ; z0 = (30,30) ;

end . 

It would not hurt to have such a clearz macro in plain.mp -) 


Hans
-------------------------------------------------------------------------
                                  Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                      Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


From - Wed Jan 17 12:13:02 2001
Return-Path: <B.Jackowski@gust.org.pl>
Received: from chronos.ipipan.gda.pl (chronos.ipipan.gda.pl
    [153.19.136.16]) by nef.ens.fr (8.10.1/1.01.28121999) with SMTP id
    f0HBCqv43658 for <metafont@ens.fr>; Wed, 17 Jan 2001 12:12:52 +0100 (CET)
Received: (qmail 25931 invoked by uid 410); 17 Jan 2001 11:12:48 -0000
Date: Wed, 17 Jan 2001 12:12:48 +0100 (MET)
From: Boguslaw Jackowski <B.Jackowski@GUST.org.pl>
X-Sender: jacko@chronos.ipipan.gda.pl
To: The Discussion List of METAFONT/METAPOST <metafont@nef.ens.fr>
Subject: Re: [metafont] is it possible to refreshen a variable?
Message-Id: <Pine.LNX.4.21.0101171210480.25874-100000@chronos.ipipan.gda.pl>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Loop: metafont@nef.ens.fr
X-Sequence: 374
Precedence: list


Hans Hagen:
> So, we can define a "clearz" macro as 
> 
> vardef clearz@# =
>   x@# := whatever ;
>   y@# := whatever ;
> enddef ;
[...]
> It would not hurt to have such a clearz macro in plain.mp -) 

What about extending the functionality of `clearxy' in an
upward-compatible way:

  def clearxy text s =
   clearxy_index_:=0; for $:=s: clearxy_index_:=clearxy_index_+1; endfor;
   if clearxy_index_=0: save x,y;
   else: forsuffixes $:=s: x$:=whatever; y$:=whatever; endfor;
   fi
  enddef;

Now
  clearxy;
would do what it used to do, while
  clearxy a, b;
would ``clear'' only `z.a' and `z.b'.

There are two drawbacks of the solution, as I can see:
 1. It uses a private (global) variable, `clearxy_index_', which can be
    independently (although unlikely) invented by a mad user ;-)
    We cannot use `begingroup' and `endgroup' here to have this variable
    local, because of the `save' operation -- see point 2.
 2. The operation `save' is local within group, while
    the assigments `x$:=whatever; ...' are not.

Occasionally, I use the following `local ... endlocal' construction:

  def local suffix s =
   begingroup
    save local_stack_value_, local_stack_name_;
    if pair s: pair local_stack_value_; fi
    if path s: path local_stack_value_; fi
    if picture s: picture local_stack_value_; fi
    if string s: string local_stack_value_; fi
    if color s: color local_stack_value_; fi
    local_stack_value_ = s; def local_stack_name_ = s enddef;
    local_
  enddef;
  def local_ expr x = local_stack_name_:=x enddef;
  def endlocal = local_stack_name_:=local_stack_value_; endgroup; enddef;

You can use these macros, for example, as follows:

  x1:=1;
  local x1:=whatever;
   show x1; 
   local x1:=2;
    show x1; 
   endlocal
  endlocal
  show x1;

That is, each `local' must be paired with respective `endlocal'.

Any comments?

All the best -- Jacko

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




From - Wed Jan 17 13:35:24 2001
Return-Path: <pragma@wxs.nl>
Received: from smtp8.xs4all.nl (smtp8.xs4all.nl [194.109.127.134]) by
    nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f0HCZDv53825 for
    <metafont@ens.fr>; Wed, 17 Jan 2001 13:35:14 +0100 (CET)
Received: from server-1.pragma-ade.nl (s340-isdn3030.dial.xs4all.nl
    [194.109.191.214]) by smtp8.xs4all.nl (8.9.3/8.9.3) with ESMTP id NAA00533;
    Wed, 17 Jan 2001 13:35:03 +0100 (CET)
Received: from laptop-1 (laptop-1.pragma-ade.nl [200.1.1.25]) by
    server-1.pragma-ade.nl (8.9.3/8.9.3) with SMTP id NAA12543; Wed,
    17 Jan 2001 13:24:50 +0100
Message-Id: <3.0.6.32.20010117132140.013a06c0@server-1>
X-Sender: hagen@server-1
X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.6 (32)
Date: Wed, 17 Jan 2001 13:21:40 +0100
To: Boguslaw Jackowski <B.Jackowski@GUST.org.pl>
From: Hans Hagen <pragma@wxs.nl>
Subject: Re: [metafont] is it possible to refreshen a variable?
Cc: The Discussion List of METAFONT/METAPOST <metafont@nef.ens.fr>
In-Reply-To: <Pine.LNX.4.21.0101171210480.25874-100000@chronos.ipipan.gd a.pl>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
X-Loop: metafont@nef.ens.fr
X-Sequence: 375
Precedence: list

At 12:12 PM 1/17/01 +0100, Boguslaw Jackowski wrote:
>
>Hans Hagen:
>> So, we can define a "clearz" macro as 
>> 
>> vardef clearz@# =
>>   x@# := whatever ;
>>   y@# := whatever ;
>> enddef ;
>[...]
>> It would not hurt to have such a clearz macro in plain.mp -) 
>
>What about extending the functionality of `clearxy' in an
>upward-compatible way:
>
>  def clearxy text s =
>   clearxy_index_:=0; for $:=s: clearxy_index_:=clearxy_index_+1; endfor;
>   if clearxy_index_=0: save x,y;
>   else: forsuffixes $:=s: x$:=whatever; y$:=whatever; endfor;
>   fi
>  enddef;
>
>Now
>  clearxy;
>would do what it used to do, while
>  clearxy a, b;
>would ``clear'' only `z.a' and `z.b'.
>
>There are two drawbacks of the solution, as I can see:
> 1. It uses a private (global) variable, `clearxy_index_', which can be
>    independently (although unlikely) invented by a mad user ;-)
>    We cannot use `begingroup' and `endgroup' here to have this variable
>    local, because of the `save' operation -- see point 2.
> 2. The operation `save' is local within group, while
>    the assigments `x$:=whatever; ...' are not.


You can get rid of the clearxy_index_ with : 

 def clearxy text s =
   if false for $:=s : or true endfor :
     save x,y;
   else:
     forsuffixes $:=s: x$:=whatever; y$:=whatever; endfor;
   fi
  enddef;


-------------------------------------------------------------------------
                                  Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                      Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


From - Wed Jan 17 14:08:08 2001
Return-Path: <B.Jackowski@gust.org.pl>
Received: from chronos.ipipan.gda.pl (chronos.ipipan.gda.pl
    [153.19.136.16]) by nef.ens.fr (8.10.1/1.01.28121999) with SMTP id
    f0HD7wv57210 for <metafont@ens.fr>; Wed, 17 Jan 2001 14:07:58 +0100 (CET)
Received: (qmail 27043 invoked by uid 410); 17 Jan 2001 13:07:51 -0000
Date: Wed, 17 Jan 2001 14:07:50 +0100 (MET)
From: Boguslaw Jackowski <B.Jackowski@GUST.org.pl>
X-Sender: jacko@chronos.ipipan.gda.pl
To: The Discussion List of METAFONT/METAPOST <metafont@nef.ens.fr>
Subject: Re: [metafont] is it possible to refreshen a variable?
Message-Id: <Pine.LNX.4.21.0101171406440.27018-100000@chronos.ipipan.gda.pl>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Loop: metafont@nef.ens.fr
X-Sequence: 376
Precedence: list



Hans Hagen:
> def clearxy text s =
>  if false for $:=s: or true endfor:
>   forsuffixes $:=s: x$:=whatever; y$:=whatever; endfor;
>  else: save x,y; fi
> enddef;

I knew that I could count upon you ;-)

Thanks!

-- Jacko


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




From - Thu Jan 18 14:30:56 2001
Return-Path: <Denis.Roegel@loria.fr>
Received: from lorraine.loria.fr (lorraine.loria.fr [152.81.1.17]) by
    nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f0IDUnv71484 for
    <metafont@ens.fr>; Thu, 18 Jan 2001 14:30:49 +0100 (CET)
Received: from bar.loria.fr (bar.loria.fr [152.81.2.13]) by
    lorraine.loria.fr (8.9.3/8.9.3/8.9.3/JCG-DG) with ESMTP id OAA25785;
    Thu, 18 Jan 2001 14:30:46 +0100 (MET)
From: "Denis B. Roegel" <Denis.Roegel@loria.fr>
Received: (from roegel@localhost) by bar.loria.fr
    (8.9.3/8.9.3/8.9.3-client/JCG) id OAA16356; Thu, 18 Jan 2001 14:30:41
    +0100 (MET)
Message-Id: <200101181330.OAA16356@bar.loria.fr>
Subject: Re: [metafont] is it possible to refresh a variable?
To: B.Jackowski@GUST.org.pl (Boguslaw Jackowski)
Date: Thu, 18 Jan 2001 14:30:41 +0100 (MET)
Cc: metafont@nef.ens.fr (The Discussion List of METAFONT/METAPOST)
In-Reply-To: <Pine.LNX.4.21.0101171406440.27018-100000@chronos.ipipan.gda.pl> from
    "Boguslaw Jackowski" at Jan 17, 2001 02:07:50 PM
X-Mailer: ELM [version 2.5 PL2]
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Loop: metafont@nef.ens.fr
X-Sequence: 377
Precedence: list

(I correct the misspelling of ``refresh'') in the subject line.)

`Boguslaw Jackowski' wrote
>   
>   
>   
>   Hans Hagen:
>   > def clearxy text s =
>   >  if false for $:=s: or true endfor:
>   >   forsuffixes $:=s: x$:=whatever; y$:=whatever; endfor;
>   >  else: save x,y; fi
>   > enddef;
>   
>   I knew that I could count upon you ;-)

Very nice indeed.

Now, continuing in this thread, we can actually extend "whatever".
Currently, "whatever" is of type numeric. But we can add other
types of whatevers. For instance, for pairs:

vardef whateverpair = save ?; pair ?; ? enddef;

This might then lead to a general "clear" macro:

  def clear test s=
    forsuffixes $:=s: 
      if numeric $:$:=whatever; 
      elseif pair $:$:=whateverpair;
      elseif ...
      fi;
    endfor;
  enddef;

Is there a way to generalize the "whatever" macro so that
one could write

  def clear test s=
    forsuffixes $:=s: 
      if numeric $:$:=whatever; 
      elseif pair $:$:=whatever pair;
      elseif picture $:$:=whatever picture;
        ...
      fi;
    endfor;
  enddef;

?

The following does of course not work:

vardef whatever test t = save ?; 
  if false for $:=t: or true endfor:else:t ?;fi ? 
enddef;

Denis







From - Mon Jan 22 15:18:20 2001
Return-Path: <taupin@lps.u-psud.fr>
Received: from upsn13.u-psud.fr (upsn13.u-psud.fr [193.55.10.113]) by
    nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f0MEI8v18306 ;
    Mon, 22 Jan 2001 15:18:08 +0100 (CET)
Received: from upsn13.u-psud.fr (localhost [127.0.0.1]) by
    upsn13.u-psud.fr (8.11.1/8.9.0) with ESMTP id f0MA73B24716 for ...;
    Mon, 22 Jan 2001 11:07:03 +0100 (MET)
Received: from upsn250.cri.u-psud.fr (upsn250.cri.u-psud.fr
    [129.175.34.250]) by upsn13.u-psud.fr (8.11.1/8.9.0) with ESMTP id
    f0MA72j24710 for ...; Mon, 22 Jan 2001 11:07:02 +0100 (MET)
Received: from lps.u-psud.fr (sol140.ppp.u-psud.fr [194.57.32.140]) by
    upsn250.cri.u-psud.fr (8.9.3/8.8.2) with ESMTP id LAA24576; Mon,
    22 Jan 2001 11:06:19 +0100
Message-Id: <3A6C07FF.A3D117C2@lps.u-psud.fr>
Date: Mon, 22 Jan 2001 11:14:23 +0100
From: taupin <taupin@lps.u-psud.fr>
X-Mailer: Mozilla 4.51 [en] (Win98; I)
X-Accept-Language: en
Mime-Version: 1.0
To: TeX-Euro <tex-euro@relay.urz.uni-heidelberg.de>, Liste metafont
    <metafont@nef.ens.fr>, Liste Gutenberg <gut@nef.ens.fr>
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Loop: metafont@nef.ens.fr
X-Sequence: 378
Precedence: list
Subject: [metafont] New release of metafont version of TTF fonts

 Metafont coded TTF fonts have been updated at

ftp://ftp.lps.u-psud.fr/pub/latex/fonts/ttf/metafont/

 Change: italic corrections were missing (they are also missing in the
standard TTF fonts...) and have been implemented.
-- 

------------------------------------------------------------------------
  Daniel Taupin, Physique des Solides, Univ. Paris-Sud, 91405 ORSAY
  E-mail= mailto:taupin@lps.u-psud.fr
  Tél: (33)1.69.15.60.79, Fax: (33)1.69.15.60.86, home/fax:
(33)1.60.10.26.44

------------------------------------------------------------------------

From - Mon Jan 22 15:42:32 2001
Return-Path: <be@et.dtu.dk>
Received: from brayton.et.dtu.dk (brayton.et.dtu.dk [130.225.70.231]) by
    nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f0MEgNv21144 for
    <metafont@ens.fr>; Mon, 22 Jan 2001 15:42:23 +0100 (CET)
Received: from et.dtu.dk (brian@euler.et.dtu.dk [130.225.70.230]) by
    brayton.et.dtu.dk (8.9.3 (PHNE_18979)/8.9.3) with ESMTP id PAA15356;
    Mon, 22 Jan 2001 15:38:59 GMT
Sender: brian@brayton.et.dtu.dk
Message-Id: <3A6C5320.924549F5@et.dtu.dk>
Date: Mon, 22 Jan 2001 16:34:56 +0100
From: Brian Elmegaard <be@et.dtu.dk>
Organization: Department of Energy Engineering, Technical University of
    Denmark
X-Mailer: Mozilla 4.7 [en] (X11; I; HP-UX B.10.20 9000/715)
X-Accept-Language: en
Mime-Version: 1.0
To: metafont@nef.ens.fr
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Loop: metafont@nef.ens.fr
X-Sequence: 379
Precedence: list
Subject: [metafont] mpcirc for process diagrams

Hi,

I have grabbed the mpcirc package of Tomasz Cholewo and I try to make it useful
for drawing flowsheets for process plants (chemical, power aso).

In the standard for these drawings the given line styles indicate what type of
flow is in a connection between two components. The mpcirc package always uses a
full line.

What I need is, for instance, to draw two parallel lines where one is dashed,
one is full and also a triple line where a thick dashed line is surrounded by
two thin full lines. I would of course appreciate if this might be done only
defining a special pen, but I don't think this is a possible solution. 

Do any of you know if I can do something similar to what is done with double
lines in the feynmf/mp package or would you recommend another approach?

Thank you for any input.

-- 
Brian Elmegaard (be@et.dtu.dk) http://www.et.dtu.dk/energysystems 
Dept. of Energy Engineering, Technical University of Denmark, 
Phone +45 4525 4169  Fax +45 4593 5215
:) http://www.rk-speed.dk http://fiduso.dk http://sunsite.auc.dk/dk-tug

From - Mon Jan 22 22:48:11 2001
Return-Path: <Denis.Roegel@loria.fr>
Received: from lorraine.loria.fr (lorraine.loria.fr [152.81.1.17]) by
    nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f0MLm4v64311 for
    <metafont@ens.fr>; Mon, 22 Jan 2001 22:48:04 +0100 (CET)
Received: from bar.loria.fr (bar.loria.fr [152.81.2.13]) by
    lorraine.loria.fr (8.9.3/8.9.3/8.9.3/JCG-DG) with ESMTP id WAA17353;
    Mon, 22 Jan 2001 22:48:03 +0100 (MET)
From: "Denis B. Roegel" <Denis.Roegel@loria.fr>
Received: (from roegel@localhost) by bar.loria.fr
    (8.9.3/8.9.3/8.9.3-client/JCG) id WAA18776; Mon, 22 Jan 2001 22:48:03
    +0100 (MET)
Message-Id: <200101222148.WAA18776@bar.loria.fr>
To: metafont@nef.ens.fr
Date: Mon, 22 Jan 2001 22:48:03 +0100 (MET)
Cc: roegel@lorraine.loria.fr (Denis B. Roegel)
X-Mailer: ELM [version 2.5 PL2]
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Loop: metafont@nef.ens.fr
X-Sequence: 380
Precedence: list
Subject: [metafont] is it possible to go through all variables a.* ?

Is it possible to loop over all suffixes
corresponding to variables xyz* ?

For instance, assume I have

xyz=4;
string xyz.s;
picture xyz.s.t.56.f;
pair xyz34yr.21;

etc.

Can I easily loop over the suffixes 
xyz, xyz.s, xyz.s.t.56.f and xyz34yr.21 ?

Thanks,

Denis

From - Tue Jan 23 01:28:24 2001
Return-Path: <gt@ee.latrobe.edu.au>
Received: from well.ee.latrobe.edu.au (well.ee.latrobe.edu.au
    [131.172.45.105]) by nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id
    f0N0SDv74578 for <metafont@ens.fr>; Tue, 23 Jan 2001 01:28:14 +0100 (CET)
Received: from localhost (gt@localhost [127.0.0.1]) by
    well.ee.latrobe.edu.au (8.9.3/8.9.3) with ESMTP id LAA28094;
    Tue, 23 Jan 2001 11:30:37 +1100
Date: Tue, 23 Jan 2001 11:30:36 +1100 (EST)
From: Geoffrey Tobin <gt@ee.latrobe.edu.au>
To: Brian Elmegaard <be@et.dtu.dk>
Cc: metafont@nef.ens.fr
Subject: Re: [metafont] mpcirc for process diagrams
In-Reply-To: <3A6C5320.924549F5@et.dtu.dk>
Message-Id: <Pine.LNX.4.10.10101231125140.28067-100000@well.ee.latrobe.edu.au>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Loop: metafont@nef.ens.fr
X-Sequence: 381
Precedence: list

On Mon, 22 Jan 2001, Brian Elmegaard wrote:

BE>I have grabbed the mpcirc package of Tomasz Cholewo and I try to
BE>make it useful for drawing flowsheets for process plants
BE>(chemical, power aso).
BE>
BE>In the standard for these drawings the given line styles indicate
BE>what type of flow is in a connection between two components.
BE>The mpcirc package always uses a full line.
BE>
BE>What I need is, for instance, to draw two parallel lines where one
BE>is dashed, one is full and also a triple line where a thick dashed
BE>line is surrounded by two thin full lines.
...
BE>Do any of you know if I can do something similar to what is done
BE>with double lines in the feynmf/mp package or would you recommend
BE>another approach?

Have you considered a more general tool?  Such as mfpic?  The current
version has metapost output.  It should be quite feasible to "roll
your own" function for the task.

Best wishes!
Geoffrey Tobin
Email:  gt@ee.latrobe.edu.au
WWW:    http://www.ee.latrobe.edu.au/~gt/gt.html


From - Tue Jan 23 12:54:15 2001
Return-Path: <be@mek.dtu.dk>
Received: from brayton.et.dtu.dk (brayton.et.dtu.dk [130.225.70.231]) by
    nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f0NBs3v19624 for
    <metafont@ens.fr>; Tue, 23 Jan 2001 12:54:03 +0100 (CET)
Received: from mek.dtu.dk (brian@euler.et.dtu.dk [130.225.70.230]) by
    brayton.et.dtu.dk (8.9.3 (PHNE_18979)/8.9.3) with ESMTP id MAA15955;
    Tue, 23 Jan 2001 12:50:41 GMT
Sender: brian@brayton.et.dtu.dk
Message-Id: <3A6D7D26.45AEBD6D@mek.dtu.dk>
Date: Tue, 23 Jan 2001 13:46:30 +0100
From: Brian Elmegaard <be@mek.dtu.dk>
Organization: Department of Energy Engineering, Technical University of
    Denmark
X-Mailer: Mozilla 4.7 [en] (X11; I; HP-UX B.10.20 9000/715)
X-Accept-Language: en
Mime-Version: 1.0
To: metafont@nef.ens.fr
Subject: Re: [metafont] mpcirc for process diagrams
References: <Pine.LNX.4.10.10101231125140.28067-100000@well.ee.latrobe.edu.au>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Loop: metafont@nef.ens.fr
X-Sequence: 382
Precedence: list

Geoffrey Tobin wrote:
> 
> 
> Have you considered a more general tool?  Such as mfpic?  The current

Yes, but not exactly mfpic. However, what I need is very similar to mpcirc and
the tex circ-macros, so I think I am on the right track. 

To me mfpic doesn't seem be like the circ-packages where you make a macro for a
given device in the systems and add pins to it as wanted. The devices are
connected by vertical/horiontal lines between the pins. 

> version has metapost output.  It should be quite feasible to "roll
> your own" function for the task.

Seems interesting, however, making the highly specialized line styles. Could
that be possible with mfpic?

-- 
Brian Elmegaard (be@et.dtu.dk) http://www.et.dtu.dk/energysystems 
Dept. of Energy Engineering, Technical University of Denmark, 
Phone +45 4525 4169  Fax +45 4593 5215
:) http://www.rk-speed.dk http://fiduso.dk http://sunsite.auc.dk/dk-tug

From - Tue Jan 23 18:49:48 2001
Return-Path: <luecking@uark.edu>
Received: from mail.uark.edu (mail.uark.edu [130.184.5.107]) by nef.ens.fr
    (8.10.1/1.01.28121999) with ESMTP id f0NHnev55932 for <metafont@ens.fr>;
    Tue, 23 Jan 2001 18:49:40 +0100 (CET)
Received: from comp.uark.edu ([130.184.5.197]) by mail.uark.edu (Netscape
    Messaging Server 4.15) with ESMTP id G7MMUQ01.I5Y; Tue, 23 Jan 2001
    11:49:38 -0600
Received: (from luecking@localhost) by comp.uark.edu (8.10.2/8.10.2) id
    f0NHnbr25013; Tue, 23 Jan 2001 11:49:37 -0600 (CST)
Date: Tue, 23 Jan 2001 11:49:37 -0600 (CST)
From: "Daniel Luecking" <luecking@uark.edu>
To: Brian Elmegaard <be@mek.dtu.dk>
Cc: metafont@nef.ens.fr
Subject: Re: [metafont] mpcirc for process diagrams
In-Reply-To: <3A6D7D26.45AEBD6D@mek.dtu.dk>
Message-Id: <Pine.SOL.4.10.10101231138360.18591-100000@comp.uark.edu>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Loop: metafont@nef.ens.fr
X-Sequence: 383
Precedence: list

On Tue, 23 Jan 2001, Brian Elmegaard wrote:

> Geoffrey Tobin wrote:
> > 
> > 
> > Have you considered a more general tool?  Such as mfpic?  The current
> 
> Yes, but not exactly mfpic. However, what I need is very similar to mpcirc and
> the tex circ-macros, so I think I am on the right track. 
> 
> To me mfpic doesn't seem be like the circ-packages where you make a 
> macro for a
> given device in the systems and add pins to it as wanted. The devices are
> connected by vertical/horiontal lines between the pins. 
> 
> > version has metapost output.  It should be quite feasible to "roll
> > your own" function for the task.
> 
> Seems interesting, however, making the highly specialized line styles. Could
> that be possible with mfpic?

Theoretically, what you can do in Metafont or MetaPost you can do in
mfpic, but TeX adds a slight extra layer. On the one hand, mfpic makes
it easy to do common shapes and graph functions, but writing TeX macros
to place and rearrange those shapes does not really give what it seems
you need. It sounds like you want to do things that require computations
of coordinates, for which MF or MP is well suited, but TeX just gets in
the way.

Speaking as one of the co-writers of mfpic, I would probably first
investigate trying to modify mpcirc or add to it. But then I may just be
blowing smoke because I don't know anything about mpcirc. Where does one
get it?


-- 
Dan Luecking                           Dept. of Mathematical Sciences     
luecking@comp.uark.edu                 University of Arkansas      
http://comp.uark.edu/~luecking/        Fayetteville, AR 72101



From - Thu Jan 25 10:24:35 2001
Return-Path: <be@mek.dtu.dk>
Received: from brayton.et.dtu.dk (brayton.et.dtu.dk [130.225.70.231]) by
    nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f0P9OSv26904 for
    <metafont@ens.fr>; Thu, 25 Jan 2001 10:24:28 +0100 (CET)
Received: from mek.dtu.dk (brian@euler.et.dtu.dk [130.225.70.230]) by
    brayton.et.dtu.dk (8.9.3 (PHNE_18979)/8.9.3) with ESMTP id KAA16918;
    Thu, 25 Jan 2001 10:21:04 GMT
Sender: brian@brayton.et.dtu.dk
Message-Id: <3A6FFD0C.E061C060@mek.dtu.dk>
Date: Thu, 25 Jan 2001 11:16:44 +0100
From: Brian Elmegaard <be@mek.dtu.dk>
Organization: Department of Energy Engineering, Technical University of
    Denmark
X-Mailer: Mozilla 4.7 [en] (X11; I; HP-UX B.10.20 9000/715)
X-Accept-Language: en
Mime-Version: 1.0
To: metafont@nef.ens.fr
Subject: Re: [metafont] mpcirc for process diagrams
References: <Pine.LNX.4.10.10101241429490.32116-100000@well.ee.latrobe.edu.au>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Loop: metafont@nef.ens.fr
X-Sequence: 384
Precedence: list

Geoffrey Tobin wrote:

> 
> That's true, but all you need is a pair variable for each pin
> to specify its coordinates, and some code to make the connections.

Sure, but there are a few thing which come with mpcirc which make it very
similar to what I need. See
http://www.ci.louisville.edu/tom/software/LaTeX/mpcirc/

> 
> How specialised is highly specialised?  Mfpic has dot, dash and
> repeated symbol line patterns, and color.

I need dashdotted, which would be simple, 

but I also need the pen that I would make with

p0=z0--z1;
draw (z0--z1) withpen pensquare scaled 2pt dashed evenly;
draw p0 shifted (0,2pt) withpen pensquare;
draw p0 shifted (0,-2pt) withpen pensquare;

and another
p0=z0--z1;
draw p0 shifted (0,1pt) withpen pensquare;
draw p0 shifted (0,-1pt) withpen pensquare dashdotted;

and more of the kind.

-- 
Brian Elmegaard (be@et.dtu.dk) http://www.et.dtu.dk/energysystems 
Dept. of Energy Engineering, Technical University of Denmark, 
Phone +45 4525 4169  Fax +45 4593 5215
:) http://www.rk-speed.dk http://fiduso.dk http://sunsite.auc.dk/dk-tug

From - Thu Jan 25 10:27:16 2001
Return-Path: <be@mek.dtu.dk>
Received: from brayton.et.dtu.dk (brayton.et.dtu.dk [130.225.70.231]) by
    nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f0P9R6v27105 for
    <metafont@ens.fr>; Thu, 25 Jan 2001 10:27:06 +0100 (CET)
Received: from mek.dtu.dk (brian@euler.et.dtu.dk [130.225.70.230]) by
    brayton.et.dtu.dk (8.9.3 (PHNE_18979)/8.9.3) with ESMTP id KAA16930;
    Thu, 25 Jan 2001 10:23:45 GMT
Sender: brian@brayton.et.dtu.dk
Message-Id: <3A6FFDB6.E1A25457@mek.dtu.dk>
Date: Thu, 25 Jan 2001 11:19:35 +0100
From: Brian Elmegaard <be@mek.dtu.dk>
Organization: Department of Energy Engineering, Technical University of
    Denmark
X-Mailer: Mozilla 4.7 [en] (X11; I; HP-UX B.10.20 9000/715)
X-Accept-Language: en
Mime-Version: 1.0
To: metafont@nef.ens.fr
Subject: Re: [metafont] mpcirc for process diagrams
References: <Pine.SOL.4.10.10101231138360.18591-100000@comp.uark.edu>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Loop: metafont@nef.ens.fr
X-Sequence: 385
Precedence: list

Daniel Luecking wrote:
> 
> On Tue, 23 Jan 2001, Brian Elmegaard wrote:
> 
> to place and rearrange those shapes does not really give what it seems
> you need. It sounds like you want to do things that require computations
> of coordinates, for which MF or MP is well suited, but TeX just gets in
> the way.
> 
I think you are right.

> Speaking as one of the co-writers of mfpic, I would probably first
> investigate trying to modify mpcirc or add to it. But then I may just be
> blowing smoke because I don't know anything about mpcirc. Where does one
> get it?

http://www.ci.louisville.edu/tom/software/LaTeX/mpcirc/

I believe I have found searching for metapost on yahoo, but it also be a link
from the metapost page.

-- 
Brian Elmegaard (be@et.dtu.dk) http://www.et.dtu.dk/energysystems 
Dept. of Energy Engineering, Technical University of Denmark, 
Phone +45 4525 4169  Fax +45 4593 5215
:) http://www.rk-speed.dk http://fiduso.dk http://sunsite.auc.dk/dk-tug

From - Thu Jan 25 12:05:30 2001
Return-Path: <henkel@vh-s.de>
Received: from mailout06.sul.t-online.com (mailout06.sul.t-online.com
    [194.25.134.19]) by nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id
    f0PB5Kv38320 for <metafont@ens.fr>; Thu, 25 Jan 2001 12:05:20 +0100 (CET)
Received: from fwd06.sul.t-online.com by mailout06.sul.t-online.com with
    smtp id 14LkDM-0004F8-00; Thu, 25 Jan 2001 12:05:16 +0100
Received: from vhssv1.vhs (320016211760-0001@[62.158.0.127]) by
    fmrl06.sul.t-online.com with esmtp id 14LkDD-1N80jAC; Thu, 25 Jan 2001
    12:05:07 +0100
Received: from hahepc.vhs (mail@hahepc.vhs [192.168.0.3]) by vhssv1.vhs
    (8.8.8/8.8.8) with ESMTP id MAA12622; Thu, 25 Jan 2001 12:05:05 +0100
Received: from hahe (helo=localhost) by hahepc.vhs with local-esmtp (Exim
    3.12 #1 (Debian)) id 14LkDC-0004m6-00; Thu, 25 Jan 2001 12:05:06 +0100
Date: Thu, 25 Jan 2001 12:05:06 +0100 (CET)
From: Hartmut Henkel <henkel@vh-s.de>
To: Brian Elmegaard <be@et.dtu.dk>
Cc: metafont@nef.ens.fr
Subject: [metafont] Re: mpcirc for process diagrams
In-Reply-To: <3A6C5320.924549F5@et.dtu.dk>
Message-Id: <Pine.LNX.4.21.0101251155540.18338-100000@hahepc.vhs>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Sender: 320016211760-0001@t-dialin.net
X-Loop: metafont@nef.ens.fr
X-Sequence: 386
Precedence: list

Hi, 

might be the `penpos' macro in MetaPost/MetaFont helps: This allows
to define points z.l and z.r left and right to some point z, and give
their orientation. The orientation can also be calculated to be always
orthogonal to the center line. See the MetaFont book, page 26.

With this you can draw additional lines accompanying a center line;
and all lines in different style. The following is a simple example
(with manual orientations):

prologues:=1;
beginfig(1)
z1=origin;
z2=(50mm,25mm);
z3=(100mm,50mm);
penpos1(5mm,90);
penpos2(5mm,135);
penpos3(5mm,90);
draw z1{right}..z2..{right}z3 dashed evenly;
draw z1l{right}..z2l..{right}z3l;
draw z1r{right}..z2r..{right}z3r withpen pencircle scaled 1mm;
endfig
end

Best Regards

Hartmut


On Mon, 22 Jan 2001, Brian Elmegaard wrote:

> Hi,
> 
> I have grabbed the mpcirc package of Tomasz Cholewo and I try to make it useful
> for drawing flowsheets for process plants (chemical, power aso).
> 
> In the standard for these drawings the given line styles indicate what type of
> flow is in a connection between two components. The mpcirc package always uses a
> full line.
> 
> What I need is, for instance, to draw two parallel lines where one is dashed,
> one is full and also a triple line where a thick dashed line is surrounded by
> two thin full lines. I would of course appreciate if this might be done only
> defining a special pen, but I don't think this is a possible solution. 
> 
> Do any of you know if I can do something similar to what is done with double
> lines in the feynmf/mp package or would you recommend another approach?
> 
> Thank you for any input.
> 
> -- 
> Brian Elmegaard (be@et.dtu.dk) http://www.et.dtu.dk/energysystems 
> Dept. of Energy Engineering, Technical University of Denmark, 
> Phone +45 4525 4169  Fax +45 4593 5215
> :) http://www.rk-speed.dk http://fiduso.dk http://sunsite.auc.dk/dk-tug


------------------------------------------------------------------------
Dr.-Ing. Hartmut Henkel
von Hoerner & Sulger GmbH
Schlossplatz 8
D-68723 Schwetzingen, Germany
Tel. (+49) 6202/5756-16, -0 (Operator)
FAX (+49) 6202/5756-55
E-Mail henkel@vh-s.de
WWW http://www.vh-s.de
------------------------------------------------------------------------


From - Thu Jan 25 14:17:45 2001
Return-Path: <B.Jackowski@gust.org.pl>
Received: from chronos.ipipan.gda.pl (chronos.ipipan.gda.pl
    [153.19.136.16]) by nef.ens.fr (8.10.1/1.01.28121999) with SMTP id
    f0PDHHv50892 for <metafont@ens.fr>; Thu, 25 Jan 2001 14:17:18 +0100 (CET)
Received: (qmail 14032 invoked by uid 410); 25 Jan 2001 13:16:56 -0000
Date: Thu, 25 Jan 2001 14:16:55 +0100 (MET)
From: Boguslaw Jackowski <B.Jackowski@GUST.org.pl>
X-Sender: jacko@chronos.ipipan.gda.pl
To: The Discussion List of METAFONT/METAPOST <metafont@nef.ens.fr>
Subject: Re: [metafont] is it possible to go through all variables a.* ?
Message-Id: <Pine.LNX.4.21.0101251415340.13933-100000@chronos.ipipan.gda.pl>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Loop: metafont@nef.ens.fr
X-Sequence: 387
Precedence: list


Denis B. Roegel <Denis.Roegel@loria.fr>:
> Is it possible to loop over all suffixes
> corresponding to variables xyz* ?

Nice question.

The only solution I can fancy is the postprocessing of the log file.  In
your MP/MF program you invoke `showvariable xyz' and then you can use AWK
or Perl or what-not to parse log. Admittedly ugly.

Does anybody know what are the reasons for not introducing something
like `forallsuffixes' loop? Perhaps it is John, who knows the answer?

Best regards -- Jacko


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




From - Fri Jan 26 06:26:40 2001
Return-Path: <Denis.Roegel@loria.fr>
Received: from lorraine.loria.fr (lorraine.loria.fr [152.81.1.17]) by
    nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f0Q5QVv22488 for
    <metafont@ens.fr>; Fri, 26 Jan 2001 06:26:31 +0100 (CET)
Received: from bar.loria.fr (bar.loria.fr [152.81.2.13]) by
    lorraine.loria.fr (8.9.3/8.9.3/8.9.3/JCG-DG) with ESMTP id GAA01808;
    Fri, 26 Jan 2001 06:26:30 +0100 (MET)
From: "Denis B. Roegel" <Denis.Roegel@loria.fr>
Received: (from roegel@localhost) by bar.loria.fr
    (8.9.3/8.9.3/8.9.3-client/JCG) id GAA03427; Fri, 26 Jan 2001 06:26:29
    +0100 (MET)
Message-Id: <200101260526.GAA03427@bar.loria.fr>
To: metafont@nef.ens.fr
Date: Fri, 26 Jan 2001 06:26:29 +0100 (MET)
Cc: roegel@lorraine.loria.fr (Denis B. Roegel)
X-Mailer: ELM [version 2.5 PL2]
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Loop: metafont@nef.ens.fr
X-Sequence: 388
Precedence: list
Subject: [metafont] Problem with memory leak in metapost

Hello,

While working on a large package (not yet public), 
I all of sudden stumbled over a strange problem. 
My file would not compile and be
sensitive to normally irrelevant matters:

  - often, the file would compile again if renamed;
  - the file would compile again if I removed
    some part of even non-used code;

This is typical of the strange errors you get with
malloc/free problems or overstepping the boundaries
of arrays (that may be more relevant to MP).

The problem has something to do with strings,
because I can see that the name of a string was trimmed,
and I can even change the amount it is trimmed of by
changing other string names.

I met the problem on MetaPost, Version 0.641 (Web2C 7.3.1)
on linux, and at the time of the error, tracingstats would give:

Here is how much of MetaPost's memory you used:
 1055 strings out of 13586
 35847 string characters out of 126406
 44980 words of memory out of 263001
 828 symbolic tokens out of 9500
 36i,62n,75p,778b stack positions out of 300i,300n,150p,3000b
 5 string compactions (moved 123209 characters, 3954 strings)

So, I am not even at the limits, or am I?

If I rename the file (into a different length file name, in this 
case one character *longer*) and get a correct compilation, I have

 1055 strings out of 13586
 35854 string characters out of 126406
 45980 words of memory out of 263001
 827 symbolic tokens out of 9500
 36i,62n,75p,782b stack positions out of 300i,300n,150p,3000b
 5 string compactions (moved 123241 characters, 3955 strings)

Now, if I make the same test on solaris with
MetaPost, Version 0.641 (Web2C 7.3.2x) (from the TeXlive 5),
I get:

(first case)
 1055 strings out of 13584
 35847 string characters out of 176400
 45980 words of memory out of 1000001
 827 symbolic tokens out of 9500
 36i,62n,75p,781b stack positions out of 300i,300n,150p,200000b
 3 string compactions (moved 72139 characters, 2307 strings)

In this case I have no error. But I am quite surprised
to see that the string compactions are different. Can somebody
explain or comment?

In the second case (with the other file name), I get:

(second case)
 1055 strings out of 13584
 35854 string characters out of 176400
 45980 words of memory out of 1000001
 827 symbolic tokens out of 9500
 36i,62n,75p,782b stack positions out of 300i,300n,150p,200000b
 3 string compactions (moved 72160 characters, 2307 strings)

It is not clear to me if the problem does still exist or
if it was solved sometime. Does anybody know?

In the meantime, I solved the problem by increasing the pool_size
value on my linux box.

The file which exhibits the problem is very large and
difficult to reduce, because every reduction makes the
error vanish :-) However, if there is a need for it,
I can try to see if I can recreate the error by
simultaneously reducing pool_size.

Thanks,

Denis Roegel




From - Fri Jan 26 09:19:07 2001
Return-Path: <be@mek.dtu.dk>
Received: from brayton.et.dtu.dk (brayton.et.dtu.dk [130.225.70.231]) by
    nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f0Q8Ixv30837 for
    <metafont@ens.fr>; Fri, 26 Jan 2001 09:18:59 +0100 (CET)
Received: from mek.dtu.dk (brian@euler.et.dtu.dk [130.225.70.230]) by
    brayton.et.dtu.dk (8.9.3 (PHNE_18979)/8.9.3) with ESMTP id JAA17539;
    Fri, 26 Jan 2001 09:15:39 GMT
Sender: brian@brayton.et.dtu.dk
Message-Id: <3A713F3F.73B897FE@mek.dtu.dk>
Date: Fri, 26 Jan 2001 10:11:27 +0100
From: Brian Elmegaard <be@mek.dtu.dk>
Organization: Department of Energy Engineering, Technical University of
    Denmark
X-Mailer: Mozilla 4.7 [en] (X11; I; HP-UX B.10.20 9000/715)
X-Accept-Language: en
Mime-Version: 1.0
To: metafont@nef.ens.fr
Subject: Re: [metafont] Re: mpcirc for process diagrams
References: <Pine.LNX.4.21.0101251155540.18338-100000@hahepc.vhs>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Loop: metafont@nef.ens.fr
X-Sequence: 389
Precedence: list

Hartmut Henkel wrote:
> 
> Hi,
> 
> might be the `penpos' macro in MetaPost/MetaFont helps: This allows
> to define points z.l and z.r left and right to some point z, and give
> their orientation. The orientation can also be calculated to be always
> orthogonal to the center line. See the MetaFont book, page 26.

This is indeed what I need...I believe. I will try it to implement it.


-- 
Brian Elmegaard (be@et.dtu.dk) http://www.et.dtu.dk/energysystems 
Dept. of Energy Engineering, Technical University of Denmark, 
Phone +45 4525 4169  Fax +45 4593 5215
:) http://www.rk-speed.dk http://fiduso.dk http://sunsite.auc.dk/dk-tug

From - Wed Jan 31 11:02:39 2001
Return-Path: <pragma@wxs.nl>
Received: from smtp1.xs4all.nl (smtp1.xs4all.nl [194.109.127.131]) by
    nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id f0VA2W525452 for
    <metafont@ens.fr>; Wed, 31 Jan 2001 11:02:32 +0100 (CET)
Received: from server-1.pragma-ade.nl (s340-isdn2681.dial.xs4all.nl
    [194.109.190.121]) by smtp1.xs4all.nl (8.9.3/8.9.3) with ESMTP id LAA22476;
    Wed, 31 Jan 2001 11:02:31 +0100 (CET)
Received: from laptop-1 (laptop-1.pragma-ade.nl [200.1.1.25]) by
    server-1.pragma-ade.nl (8.9.3/8.9.3) with SMTP id KAA10486; Wed,
    31 Jan 2001 10:43:16 +0100
Message-Id: <3.0.6.32.20010131103858.01c09d20@server-1>
X-Sender: hagen@server-1
X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.6 (32)
Date: Wed, 31 Jan 2001 10:38:58 +0100
To: Boguslaw Jackowski <B.Jackowski@GUST.org.pl>
From: Hans Hagen <pragma@wxs.nl>
Subject: Re: [metafont] is it possible to refreshen a variable?
Cc: The Discussion List of METAFONT/METAPOST <metafont@nef.ens.fr>
In-Reply-To: <Pine.LNX.4.21.0101171406440.27018-100000@chronos.ipipan.gd a.pl>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
X-Virus-Scanner: AMaVis 0.2.0-pre6 / Virus Scan
X-Loop: metafont@nef.ens.fr
X-Sequence: 390
Precedence: list

At 02:07 PM 1/17/01 +0100, Boguslaw Jackowski wrote:
>
>
>Hans Hagen:
>> def clearxy text s =
>>  if false for $:=s: or true endfor:
>>   forsuffixes $:=s: x$:=whatever; y$:=whatever; endfor;
>>  else: save x,y; fi
>> enddef;
>
>I knew that I could count upon you ;-)

should be:  

def clearxy text s =
  if false forsuffixes $ := s : or true endfor :
    save x, y ;
  else :
    forsuffixes $ := s : x$ := whatever ; y$ := whatever ; endfor ;
  fi ;
enddef ;


-------------------------------------------------------------------------
                                  Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                      Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


