From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/80382 Path: news.gmane.org!not-for-mail From: PELLOUIN Christophe Newsgroups: gmane.comp.tex.context Subject: Re: Problem with arguments in macro Date: Mon, 21 Jan 2013 21:25:31 +0100 Message-ID: <50FDA43B.4090906@wanadoo.fr> References: <50FD8872.6090801@wanadoo.fr> <50FD89C6.8070807@wxs.nl> <50FD9B6D.5090907@wanadoo.fr> <50FD9C1D.5030306@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1358799939 26598 80.91.229.3 (21 Jan 2013 20:25:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 21 Jan 2013 20:25:39 +0000 (UTC) Cc: mailing list for ConTeXt users To: Hans Hagen Original-X-From: ntg-context-bounces@ntg.nl Mon Jan 21 21:25:57 2013 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TxNwK-0008DN-7v for gctc-ntg-context-518@m.gmane.org; Mon, 21 Jan 2013 21:25:56 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 082DC101EE; Mon, 21 Jan 2013 21:25:39 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 8sL8aklEqJ7d; Mon, 21 Jan 2013 21:25:36 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id E3ADE101E5; Mon, 21 Jan 2013 21:25:35 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 9D184101E5 for ; Mon, 21 Jan 2013 21:25:34 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id POdvhjWDn4be for ; Mon, 21 Jan 2013 21:25:33 +0100 (CET) Original-Received: from filter2-ams.mf.surf.net (filter2-ams.mf.surf.net [192.87.102.70]) by balder.ntg.nl (Postfix) with ESMTP id 4DFA9101E2 for ; Mon, 21 Jan 2013 21:25:33 +0100 (CET) Original-Received: from smtp.smtpout.orange.fr (smtp12.smtpout.orange.fr [80.12.242.134]) by filter2-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id r0LKPVdY006471 for ; Mon, 21 Jan 2013 21:25:31 +0100 Original-Received: from [127.0.0.1] ([81.48.214.240]) by mwinf5d23 with ME id qkRX1k00H5BmLFD03kRXFg; Mon, 21 Jan 2013 21:25:31 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 In-Reply-To: <50FD9C1D.5030306@wxs.nl> X-Antivirus: avast! (VPS 130121-0, 21/01/2013), Outbound message X-Antivirus-Status: Clean X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=80.12.242.134; country=FR; latitude=46.0000; longitude=2.0000; http://maps.google.com/maps?q=46.0000,2.0000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0QIOIpvuS - 9bc8b35d0823 - 20130121 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.70 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:80382 Archived-At: Le 21/01/2013 20:50, Hans Hagen a =E9crit : > On 1/21/2013 8:47 PM, PELLOUIN Christophe wrote: >> Le 21/01/2013 19:32, Hans Hagen a =E9crit : >>> On 1/21/2013 7:26 PM, PELLOUIN Christophe wrote: >>>> 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_=3D15; >>>> show("second test"); >>>> show max (1,2,8,5,v_,2,1,4); >>>> >>>> numeric u_; >>>> u_=3D15 % 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 >>> >>> I can protect all local plain variables if needed but I'll only do it >>> if someone then tests all the plain macros. >> >> How can I protect a variable? I had the same bug in one of my macros and >> I'd like to fix it. > > my_private_u Ok. Thank you > > ----------------------------------------------------------------- > 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 t= he Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-cont= ext webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________= ________