Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) by h1439878.stratoserver.net (8.14.2/8.14.2/Debian-2build1) with ESMTP id s7JIFbgH007571 for ; Tue, 19 Aug 2014 20:15:38 +0200 Received: from relay.uni-heidelberg.de ([129.206.100.212]) by mx-ha.gmx.net (mxgmx005) with ESMTPS (Nemesis) id 0MVJU6-1Wrqg92ges-00YhqN for ; Tue, 19 Aug 2014 20:15:31 +0200 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [129.206.100.94]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id s7JIAg4W019775 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 19 Aug 2014 20:10:42 +0200 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [127.0.0.1]) by listserv.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id s7JAZngD007902; Tue, 19 Aug 2014 20:10:42 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 11302302 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Tue, 19 Aug 2014 20:10:41 +0200 Received: from relay2.uni-heidelberg.de (relay2.uni-heidelberg.de [129.206.210.211]) by listserv.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id s7JIAfoq005587 for ; Tue, 19 Aug 2014 20:10:41 +0200 Received: from mail-in-04.arcor-online.net (mail-in-04.arcor-online.net [151.189.21.44]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id s7JIAZ8F007581 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Tue, 19 Aug 2014 20:10:35 +0200 Received: from mail-in-13-z2.arcor-online.net (mail-in-13-z2.arcor-online.net [151.189.8.30]) by mx.arcor.de (Postfix) with ESMTP id 57A86A9D5F for ; Tue, 19 Aug 2014 20:10:35 +0200 (CEST) Received: from mail-in-16.arcor-online.net (mail-in-16.arcor-online.net [151.189.21.56]) by mail-in-13-z2.arcor-online.net (Postfix) with ESMTP id 5212414A567 for ; Tue, 19 Aug 2014 20:10:35 +0200 (CEST) X-Greylist: Passed host: 92.78.242.190 X-DKIM: Sendmail DKIM Filter v2.8.2 mail-in-16.arcor-online.net 2AD2582F2 Received: from [192.168.2.125] (dslb-092-078-242-190.092.078.pools.vodafone-ip.de [92.78.242.190]) (Authenticated sender: mailing_list@arcor.de) by mail-in-16.arcor-online.net (Postfix) with ESMTPA id 2AD2582F2 for ; Tue, 19 Aug 2014 20:10:35 +0200 (CEST) User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 References: <53F382C3.30901@arcor.de> <53F3877C.2070304@googlemail.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <53F3931A.4080203@arcor.de> Date: Tue, 19 Aug 2014 20:10:34 +0200 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Stephan Hennig Subject: Re: \directlua in LaTeX3 To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE In-Reply-To: <53F3877C.2070304@googlemail.com> Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: Envelope-To: X-GMX-Antispam: 0 (Mail was not recognized as spam); Detail=V3; X-GMX-Antivirus: 0 (no virus found) X-UI-Filterresults: notjunk:1;V01:K0:gLSpN2vKu/8=:FCmSoOqvZ7ATvZ03HmIQa89+Yo eoKsmObaGL7+3jC4ZPLLD+M/ZJN1s/yVW4cQGsK9bFzD+sq1jkENUUmfG+8yKVc7UjlmFDWBE uqp07wTcY/79Y+DLfmdHxuJMU0tE3yJMA5OPLC0tIiio+RiCF344cZYTosyaLnwtdVCME3na+ BRAnFVL1na7tZtvCip7IW989Gyrv1NoNhgyZ0gwWzJGgQMW4SlDg8LzZU/Py2XXBj3tv07ubn h2JEo4HTvUsRgb0zAB14PlzefzcXVicQQP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Sl5Ri3e8gcyHFMpzbki/fCLVtgmdtaLWChxuc8z9qfjJXF7J41wqsonOhLFep3ETkpm e9+AWVwArZkHCOOwFw0G+FXKR0JeZaHBSxElBkDv1WxtwZ22QQ2HXdMrXlnyCJjksDM21Y157 /saVjSk5Tp1axb3cpGSlp7sAKQ2o3wSbXkc9FxGlS2l8hTrXyKNk/U4deolbjpuu2SFrW1Dg= = X-UI-Loop:V01:2x+DrsfEwzo=:M7d4I7LwKl33AXIwBXDzWdK5OnJ1miVtknVkJjUOGN8= X-UI-Out-Filterresults: notjunk:1; Status: R X-Status: X-Keywords: X-UID: 7562 Am 19.08.2014 um 19:21 schrieb Heiko Oberdiek: >> \ExplSyntaxOn >> \directlua{ >> local myarg = '\mymacro' >> texio.write_nl('l3: argument is ' .. tostring(myarg)) >> } >> [...] >> First, spaces are gone in Lua code. Though, spaces are significant in Lua. > > `\ExplSyntaxOn' says that spaces are gone, that's the purpose of this > command. Explicit spaces are available via `~': Have already seen that when using l3's message mechanism, but didn't try in \directlua. Thanks! >> Second, variable myarg is nil with \ExplSyntaxOn. (I don't understand why.) > > Without spaces you get: > > localmyarg='\mymacro' Should have seen that by myself. Thanks again! > BTW, this is quite a risky way to pass the contents of user variables ot > Lua code. Consider syntax errors, if "\mymacro" contains ', or > "\mymacro" could even contain containing something like: > '; very evil code; local dummy=' > > There is \luaescapestring/\luatexluaescapestring: > > '\luatexluaescapestring{\mymacro}' It's actually a language string that I'm evaluating to a number via \the\csname l@#1\endcsname or \int_use:N\cs:w l@#1\cs_end: in LaTeX3 If #1 contains no valid language identifier, the expression should throw an error. So, I think I'm safe here. I'm indeed using \luaescapestring in other circumstances. Thanks! Stephan Hennig