ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-Context] MetaPost capacity exceeded.
@ 2012-11-15 11:27 Alan BRASLAU
  2012-11-15 12:21 ` Hans Hagen
  0 siblings, 1 reply; 2+ messages in thread
From: Alan BRASLAU @ 2012-11-15 11:27 UTC (permalink / raw)
  To: mailing list for ConTeXt users


! MetaPost capacity exceeded, sorry [expansion depth=10000].

I have come across this error previously
with run-away \dorecurse loops

I now have this message with a document that makes VERY heavy
use of MetaPost; I just have too many figures.

Is there some way to "flush" the running instance of MetaPost,
that is to force MPlib to respawn or something like that?
(Of course, I would then have to be careful not to rely on the
reuse of any previous MP instances...)

Alan 
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [NTG-Context] MetaPost capacity exceeded.
  2012-11-15 11:27 [NTG-Context] MetaPost capacity exceeded Alan BRASLAU
@ 2012-11-15 12:21 ` Hans Hagen
  0 siblings, 0 replies; 2+ messages in thread
From: Hans Hagen @ 2012-11-15 12:21 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 11/15/2012 12:27 PM, Alan BRASLAU wrote:
>
> ! MetaPost capacity exceeded, sorry [expansion depth=10000].

this normally points to an error in mp code, not to instances

> I have come across this error previously
> with run-away \dorecurse loops
>
> I now have this message with a document that makes VERY heavy
> use of MetaPost; I just have too many figures.
>
> Is there some way to "flush" the running instance of MetaPost,
> that is to force MPlib to respawn or something like that?
> (Of course, I would then have to be careful not to rely on the
> reuse of any previous MP instances...)

yes:

\starttext

\defineMPinstance
   [myfun-a]
   [format=metafun]

\defineMPinstance
   [myfun-b]
   [format=metafun]

\startMPdefinitions{myfun-a}
     color MyColor ; MyColor := (1,0,0) ;
\stopMPdefinitions

\startMPdefinitions{myfun-b}
     color MyColor ; MyColor := (0,1,0) ;
\stopMPdefinitions

\startuseMPgraphic{myfun-a::test-1}
     fill fullcircle scaled 1cm withcolor MyColor  ;
\stopuseMPgraphic

\startuseMPgraphic{myfun-a::test-2}
     fill fullcircle scaled 1cm withcolor MyColor ;
\stopuseMPgraphic

\startuseMPgraphic{myfun-b::test-1}
     fill fullcircle scaled 1cm withcolor MyColor  ;
\stopuseMPgraphic

\startuseMPgraphic{myfun-b::test-2}
     fill fullcircle scaled 1cm withcolor MyColor ;
\stopuseMPgraphic

\useMPgraphic{myfun-a::test-1}
\useMPgraphic{myfun-b::test-1}
\useMPgraphic{myfun-a::test-2}
\useMPgraphic{myfun-b::test-2}

\stoptext

however, during some cleanup stage something got lost ... so you need to 
fix this:

\unprotect

\def\meta_use_graphic#1#2%
   {\meta_begin_graphic_group{#1}%
    \doifsomething{#2}{\setupMPvariables[\currentMPgraphicname][#2]}%
    \getvalue{\??mpgraphic#1}%
    \meta_end_graphic_group}

\protect

there are few more places where

    \getvalue{\??mpgraphic ...

needs a #1 (I'll fix it).

So indeed you can have multiple independent instances. For instance we 
could have one for the chemical stuff which then cannot be messed up by 
other instances.

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-11-15 12:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-15 11:27 [NTG-Context] MetaPost capacity exceeded Alan BRASLAU
2012-11-15 12:21 ` Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).