ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Problem with arguments in macro
@ 2013-01-21 18:26 PELLOUIN Christophe
  2013-01-21 18:32 ` Hans Hagen
  0 siblings, 1 reply; 5+ messages in thread
From: PELLOUIN Christophe @ 2013-01-21 18:26 UTC (permalink / raw)
  To: ntg-context

Hello,

When writing a macro, I observed that some arguments are not transmitted 
correctly, particularly when the type is defined as "text".
Here is an example with the macro max defined in the file plain.mp
With this program:

     beginfig(1)

         show("first test");
         show max (1,2,8,5,15,2,1,4);

         numeric u_;
         v_=15;
         show("second test");
         show max (1,2,8,5,v_,2,1,4);

         numeric u_;
         u_=15    % u_ variable is also defined in the macro max
         show("third test");
         show max (1,2,8,5,u_,2,1,4);

     endfig;
     end

The result is:

     This is MetaPost, version 1.504 (kpathsea version 6.0.1)
     (mpost.mp (c:/texlive/2011/texmf-dist/metapost/base/plain.mp
     Preloading the plain mem file, version 1.004)) (./bizzare.mp
     >> "first test"
     >> 15
     >> "second test"
     >> 15
     >> "third test"
     >> 8 [1] )
     1 output file written: bizzare.1
     Transcript written on bizzare.log.



The third result is different because the variable u_ is defined in the 
macro max of the file plain.mp

Christophe Pellouin



___________________________________________________________________________________
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] 5+ messages in thread

end of thread, other threads:[~2013-01-21 20:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-21 18:26 Problem with arguments in macro PELLOUIN Christophe
2013-01-21 18:32 ` Hans Hagen
2013-01-21 19:47   ` PELLOUIN Christophe
2013-01-21 19:50     ` Hans Hagen
2013-01-21 20:25       ` PELLOUIN Christophe

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).