From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/84215 Path: news.gmane.org!not-for-mail From: Alan BRASLAU Newsgroups: gmane.comp.tex.context Subject: Re: new mp trickery / next challenge for alan and mari Date: Tue, 10 Sep 2013 18:34:36 +0200 Organization: CEA DSM-IRAMIS-SPEC Message-ID: <20130910183436.4050345b@iram-hb-003386.extra.cea.fr> References: <522F44A1.9050304@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1378830881 28703 80.91.229.3 (10 Sep 2013 16:34:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 10 Sep 2013 16:34:41 +0000 (UTC) Cc: pragma@wxs.nl To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Sep 10 18:34:45 2013 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VJQto-0005T3-3o for gctc-ntg-context-518@m.gmane.org; Tue, 10 Sep 2013 18:34:44 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 6049E10257; Tue, 10 Sep 2013 18:33:01 +0200 (CEST) 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 ov+rplYMhrTl; Tue, 10 Sep 2013 18:32:58 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 5A6E6101EB; Tue, 10 Sep 2013 18:32:58 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 8DE25101EB for ; Tue, 10 Sep 2013 18:32:57 +0200 (CEST) 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 zY6nkwqHJOUG for ; Tue, 10 Sep 2013 18:32:56 +0200 (CEST) Original-Received: from filter3-ams.mf.surf.net (filter3-ams.mf.surf.net [192.87.102.71]) by balder.ntg.nl (Postfix) with ESMTP id 8A3F7101E5 for ; Tue, 10 Sep 2013 18:32:56 +0200 (CEST) Original-Received: from cirse-out.extra.cea.fr (cirse-out.extra.cea.fr [132.167.192.142]) by filter3-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id r8AGYbiJ016251 for ; Tue, 10 Sep 2013 18:34:37 +0200 Original-Received: from epeire2.extra.cea.fr (epeire2.extra.cea.fr [132.167.198.32]) by cirse.extra.cea.fr (8.14.2/8.14.2/CEAnet-Internet-out-2.3) with ESMTP id r8AGYbcH016184 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 10 Sep 2013 18:34:37 +0200 Original-Received: from orpin1.extra.cea.fr (orpin1.extra.cea.fr [132.167.198.4]) by epeire2.extra.cea.fr (8.14.4/8.14.4) with ESMTP id r8AGYbNH021628; Tue, 10 Sep 2013 18:34:37 +0200 (envelope-from alan.braslau@cea.fr) Original-Received: from iram-hb-003386.extra.cea.fr (charybde.extra.cea.fr [132.166.43.102]) by orpin1.extra.cea.fr (8.13.8/8.13.8/CEAnet-Extranet-out-1.2) with ESMTP id r8AGYaG4022001; Tue, 10 Sep 2013 18:34:37 +0200 In-Reply-To: <522F44A1.9050304@wxs.nl> X-Mailer: Claws Mail 3.9.2 (GTK+ 2.24.19; amd64-portbld-freebsd9.1) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=132.167.192.142; country=FR; region=A3; city=Gif-sur-yvette; latitude=48.6833; longitude=2.1333; http://maps.google.com/maps?q=48.6833,2.1333&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 03KnsyBuj - ccdd458d575a - 20130910 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.71 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:84215 Archived-At: Indeed a challenge! Alan On Tue, 10 Sep 2013 18:11:13 +0200 Hans Hagen wrote: > Hi, > > There's now a convenient way to pass data back from an mprun to the > tex instance: > > \starttext > > \startMPcode > passvariable("version","1.0") ; > passvariable("number",123) ; > passvariable("string","whatever") ; > passvariable("point",(1,2)) ; > passvariable("triplet",(1,2,3)) ; > passvariable("quad",(1,2,3,4)) ; > passvariable("boolean",false) ; > passvariable("path",fullcircle scaled 1cm) ; > > draw fullcircle scaled 20pt ; > \stopMPcode > > \ctxlua{inspect(metapost.variables)} > > \ctxcommand{mprunvar("number")} > \ctxcommand{mprunvar("string")} > > \stoptext > > the inspect shows: > > table={ > ["boolean"]=false, > ["number"]=123, > ["path"]={ > { 10.02177, 10.02177, 12.67969, 7.36386, 7.36386, 12.67969 }, > { 0, 14.17323, 3.75914, 14.17323, -3.75914, 14.17323 }, > { -10.02177, 10.02177, -7.36386, 12.67969, -12.67969, 7.36386 }, > { -14.17323, 0, -14.17323, 3.75914, -14.17323, -3.75914 }, > { -10.02177, -10.02177, -12.67969, -7.36386, -7.36386, -12.67969 }, > { 0, -14.17323, -3.75914, -14.17323, 3.75914, -14.17323 }, > { 10.02177, -10.02177, 7.36386, -12.67969, 12.67969, -7.36386 }, > { 14.17323, 0, 14.17323, -3.75914, 14.17323, 3.75914 }, > }, > ["point"]={ 1, 2 }, > ["quad"]={ 1, 2, 3, 4 }, > ["string"]="whatever", > ["triplet"]={ 1, 2, 3 }, > ["version"]="1.0", > } > > the mprunvar pips a value or concatination to tex ___________________________________________________________________________________ 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 ___________________________________________________________________________________