From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/3553 Path: main.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: is there a problem with local definitions in metafun? Date: Fri, 08 Dec 2000 20:18:07 +0100 Sender: owner-ntg-context@let.uu.nl Message-ID: <3.0.6.32.20001208201807.015bec20@pop.wxs.nl> References: <200012081641.RAA27218@bar.loria.fr> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: main.gmane.org 1035394284 18083 80.91.224.250 (23 Oct 2002 17:31:24 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 17:31:24 +0000 (UTC) Cc: ntg-context@ntg.nl, roegel@lorraine.loria.fr (Denis B. Roegel) Original-To: "Denis B. Roegel" In-Reply-To: <200012081641.RAA27218@bar.loria.fr> Xref: main.gmane.org gmane.comp.tex.context:3553 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:3553 At 05:41 PM 12/8/00 +0100, Denis B. Roegel wrote: >When porting a standard metapost example to context, >I noticed that there was a problem with local definitions. >For instance, in my original file, I had > >beginfig(1); > > ... > def ... > > vardef ... > > other code >endfig; >end > >But I first naively translated this into > >\startuseMPgraphic{dummy} > > ... > def ... > > vardef ... > > other code >\stopuseMPgraphic > >(as it works for an example in the metafun manual) > >It didn't work with my example and I had to split the code: > >\startMPinclusions > > ... > def ... > > vardef ... >\stopMPinclusions > >\startuseMPgraphic{dummy} > other code >\stopuseMPgraphic > >Is there an explanation for this? I don't understand this. Everything between start/stop...MPgraphic becomes a begin/endfig, so local defs should end up there. A problem can arise when one graphic defined a macro and another one uses it, while the graphics are processed independently. You can so things like: \startuseMPgraphic{common} some code \stopuseMPgraphic \startuseMPgraphic{aaa} \includeMPgraphic{common} some more code \stopuseMPgraphic \useMPgraphic{aaa} 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 -------------------------------------------------------------------------