From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/69941 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: Optimal way to defining of macros in Luacode in ConTeXt Date: Wed, 13 Jul 2011 14:56:25 +0200 Message-ID: <95434AD2-8A25-413A-A4EA-6CBA6DC96776@googlemail.com> References: <4E1C6883.30300@gyza.cz> <4E1C6BA0.90008@wxs.nl> <4E1D51D5.50507@gyza.cz> <4E1D6B95.4080200@wxs.nl> <4E1D6DF9.2050700@gyza.cz> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1310561822 10648 80.91.229.12 (13 Jul 2011 12:57:02 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 13 Jul 2011 12:57:02 +0000 (UTC) To: hajtmar@gyza.cz, mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Jul 13 14:56:51 2011 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Qgyzi-0004si-NR for gctc-ntg-context-518@m.gmane.org; Wed, 13 Jul 2011 14:56:50 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 1C209CAE3B; Wed, 13 Jul 2011 14:56:49 +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 Em-okdwAqHqs; Wed, 13 Jul 2011 14:56:43 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 8B9C4CAE11; Wed, 13 Jul 2011 14:56:43 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 1BE42CAE11 for ; Wed, 13 Jul 2011 14:56:43 +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 WU5N8pwMlkGQ for ; Wed, 13 Jul 2011 14:56:30 +0200 (CEST) Original-Received: from filter1-til.mf.surf.net (filter1-til.mf.surf.net [194.171.167.217]) by balder.ntg.nl (Postfix) with ESMTP id 0016DCAE01 for ; Wed, 13 Jul 2011 14:56:29 +0200 (CEST) Original-Received: from mail-fx0-f42.google.com (mail-fx0-f42.google.com [209.85.161.42]) by filter1-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p6DCuTRK023099 for ; Wed, 13 Jul 2011 14:56:29 +0200 Original-Received: by fxe23 with SMTP id 23so5681078fxe.15 for ; Wed, 13 Jul 2011 05:56:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; bh=bIbmPKLx4x6a5NPxReZa10mhF7Fx8IHpoYboEt0A6sE=; b=sP3KiSjjhowA/nxBgwkxpUR29f0LhNAsRulMDblQ5M2Fxo80++wNxYiwAHU9nViqPY U8jqcCGDv9/rmCbXrpoFANxNW5FB7Px05yNIfXpci62kUpRqUOwU5ac8crXClotE1b6c QOsKP87sQQOsqpX6sJBOOZC9lujqVsph/8DLw= Original-Received: by 10.223.23.143 with SMTP id r15mr1706975fab.29.1310561788775; Wed, 13 Jul 2011 05:56:28 -0700 (PDT) Original-Received: from [192.168.2.31] (p5B0EF420.dip.t-dialin.net [91.14.244.32]) by mx.google.com with ESMTPS id k17sm4660523fah.37.2011.07.13.05.56.26 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 13 Jul 2011 05:56:27 -0700 (PDT) In-Reply-To: <4E1D6DF9.2050700@gyza.cz> X-Mailer: Apple Mail (2.1084) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.161.42; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 08F7oUtxq - 28901a141ac4 - 20110713 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.217 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:69941 Archived-At: Am 13.07.2011 um 12:05 schrieb Jaroslav Hajtmar: > Great!!!! > Hans, thanx very much for complete an exhaustive answer.. > It very help me to solve my module A few dozen commands to access values aren=92t a perfect solution, there are better ways to access entries from a Lua table. \starttext \startusercode entries =3D { one =3D "1", two =3D "2", three =3D "Three", five =3D "More text!" } function getentry(name) local entry =3D entries[name] or "" global.context(entry) end \stopusercode \define[1]\getentry{\usercode{getentry("#1")}} \starttabulate \NC one \EQ \getentry{one} \NC\NR \NC two \EQ \getentry{two} \NC\NR \NC three \EQ \getentry{three} \NC\NR \NC four \EQ \getentry{four} \NC\NR \NC five \EQ \getentry{five} \NC\NR \stoptabulate \stoptext Wolfgang ___________________________________________________________________________= ________ 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 ___________________________________________________________________________= ________