From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/80375 Path: news.gmane.org!not-for-mail From: PELLOUIN Christophe Newsgroups: gmane.comp.tex.context Subject: Problem with arguments in macro Date: Mon, 21 Jan 2013 19:26:58 +0100 Message-ID: <50FD8872.6090801@wanadoo.fr> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1358792826 22637 80.91.229.3 (21 Jan 2013 18:27:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 21 Jan 2013 18:27:06 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Mon Jan 21 19:27:24 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 1TxM5a-0003pe-TJ for gctc-ntg-context-518@m.gmane.org; Mon, 21 Jan 2013 19:27:22 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 98C29101EC; Mon, 21 Jan 2013 19:27:05 +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 1rL9GE5wVbj6; Mon, 21 Jan 2013 19:27:03 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 571A7101E5; Mon, 21 Jan 2013 19:27:03 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 61028101E5 for ; Mon, 21 Jan 2013 19:27:02 +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 6hC15STT6+XX for ; Mon, 21 Jan 2013 19:27:00 +0100 (CET) Original-Received: from filter5-til.mf.surf.net (filter5-til.mf.surf.net [194.171.167.221]) by balder.ntg.nl (Postfix) with ESMTP id D5B66101E2 for ; Mon, 21 Jan 2013 19:27:00 +0100 (CET) Original-Received: from smtp.smtpout.orange.fr (smtp12.smtpout.orange.fr [80.12.242.134]) by filter5-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id r0LIG9um010407 for ; Mon, 21 Jan 2013 19:16:10 +0100 Original-Received: from [127.0.0.1] ([81.48.214.240]) by mwinf5d23 with ME id qiSy1k00z5BmLFD03iSydE; Mon, 21 Jan 2013 19:26:59 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 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: 0WIOGg9Rb - 4951171d515c - 20130121 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.221 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:80375 Archived-At: 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 ___________________________________________________________________________________