From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/84555 Path: news.gmane.org!not-for-mail From: =?iso-8859-2?B?UHJvY2jhemthIEx1a+G5IEluZy4gLSBQb250ZXggcy4gci4gby4=?= Newsgroups: gmane.comp.tex.context Subject: Re: Lua & \let Date: Fri, 04 Oct 2013 11:01:16 +0200 Message-ID: References: <524E824D.5030102@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-2"; Format="flowed"; DelSp="yes" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1380877299 12148 80.91.229.3 (4 Oct 2013 09:01:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 4 Oct 2013 09:01:39 +0000 (UTC) To: "mailing list for ConTeXt users" Original-X-From: ntg-context-bounces@ntg.nl Fri Oct 04 11:01:42 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 1VS1GX-00065i-BI for gctc-ntg-context-518@m.gmane.org; Fri, 04 Oct 2013 11:01:41 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id E6D8E101EF; Fri, 4 Oct 2013 10:59:17 +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 4hcAbGlYwB6S; Fri, 4 Oct 2013 10:59:12 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 1D7BF101E9; Fri, 4 Oct 2013 10:59:12 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 91E02101E9 for ; Fri, 4 Oct 2013 10:59:10 +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 p+tzD1ugmBSe for ; Fri, 4 Oct 2013 10:59:08 +0200 (CEST) Original-Received: from filter1-ams.mf.surf.net (filter1-ams.mf.surf.net [192.87.102.69]) by balder.ntg.nl (Postfix) with ESMTP id 8E60F101E8 for ; Fri, 4 Oct 2013 10:59:08 +0200 (CEST) Original-Received: from mail.pontex.cz (mail.pontex.cz [89.233.168.98]) by filter1-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id r9491UrX024501 for ; Fri, 4 Oct 2013 11:01:30 +0200 Original-Received: from localhost ([127.0.0.1]) by mail.pontex.cz (Kerio MailServer 6.6.2) for ntg-context@ntg.nl; Fri, 4 Oct 2013 11:01:27 +0200 In-Reply-To: <524E824D.5030102@wxs.nl> User-Agent: Opera Mail/12.15 (Win32) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=89.233.168.98; country=CZ; latitude=49.7500; longitude=15.5000; http://maps.google.com/maps?q=49.7500,15.5000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0NKwV1uzb - 77ac0a754c43 - 20131004 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.69 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:84555 Archived-At: On Fri, 04 Oct 2013 10:54:37 +0200, Hans Hagen wrote: > On 10/4/2013 10:47 AM, Proch=E1zka Luk=E1=B9 Ing. - Pontex s. r. o. wrote: >> Hello all, >> >> how to call \let from within Lua? >> >> I'd need to "\let\T=3D4" using Lua. >> >> The following code doesn't work (not so surprisingly): >> >> ---- >> \startluacode >> a =3D 4 >> \stopluacode >> >> \expandafter\let\expandafter\T=3D\cldcontext{a} >> >> \starttext >> Test \T. >> \stoptext >> ---- >> >> What's the correct way? > > why let and not context.setvalue("T","4") > > anyway ... > > \startluacode > a =3D 4 > \stopluacode > > \normalexpanded{\let\noexpand\T\cldcontext{a}} > > \starttext > Test \T. > \stoptext > You need more \expandafter because \cldcontext needs two expansion steps: > \expandafter\expandafter\expandafter\let\expandafter\expandafter\expan= dafter\T\expandafter\expandafter\expandafter=3D\cldcontext{a} > but I wonder why you don use \def or \edef: > \edef\T{\cldcontext{a}} ... OK, thank you, Hans & Wolfgang, for your responses. Best regards Lukas -- = Ing. Luk=E1=B9 Proch=E1zka [mailto:LPr@pontex.cz] Pontex s. r. o. [mailto:pontex@pontex.cz] [http://www.pontex.cz] Bezov=E1 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038 ___________________________________________________________________________= ________ 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 ___________________________________________________________________________= ________