Received: from mx0.gmx.net (mx0.gmx.net [213.165.64.100]) by h1439878.stratoserver.net (8.14.2/8.14.2/Debian-2build1) with SMTP id q7O4rhuS019731 for ; Fri, 24 Aug 2012 06:53:44 +0200 Received: (qmail 26160 invoked by alias); 24 Aug 2012 04:53:38 -0000 Delivered-To: GMX delivery to rainer.schoepf@gmx.net Received: (qmail invoked by alias); 24 Aug 2012 04:53:38 -0000 Received: from relay.uni-heidelberg.de (EHLO relay.uni-heidelberg.de) [129.206.100.212] by mx0.gmx.net (mx057) with SMTP; 24 Aug 2012 06:53:38 +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 q7O4pej6014427 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 24 Aug 2012 06:51:40 +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.1) with ESMTP id q7NK8Ni8016221; Fri, 24 Aug 2012 06:51:40 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 2340064 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Fri, 24 Aug 2012 06:51:40 +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.1) with ESMTP id q7O4pejl002748 for ; Fri, 24 Aug 2012 06:51:40 +0200 Received: from mail-vb0-f49.google.com (mail-vb0-f49.google.com [209.85.212.49]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id q7O4pSho005019 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=FAIL) for ; Fri, 24 Aug 2012 06:51:31 +0200 Received: by vbbfo1 with SMTP id fo1so2154610vbb.22 for ; Thu, 23 Aug 2012 21:51:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.95.174 with SMTP id dl14mr2987657vdb.8.1345783888429; Thu, 23 Aug 2012 21:51:28 -0700 (PDT) Received: by 10.220.60.69 with HTTP; Thu, 23 Aug 2012 21:51:28 -0700 (PDT) References: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by listserv.uni-heidelberg.de id q7O4pejl002749 Message-ID: Date: Fri, 24 Aug 2012 06:51:28 +0200 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Bruno Le Floch Subject: Re: What does the `_x:` suffix mean? To: LATEX-L@listserv.uni-heidelberg.de In-Reply-To: Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: X-GMX-Antispam: 0 (BackTrace mail analyze); Detail=5D7Q89H36p4L00VTXC6D4q0N+AH0PUCnGL2vqOgpaBYL16oitsMrgDt/NQNpSCZFFjDOy 97xb7Zpf+wZnd5ZXNcvLDXR3Wg3wRjdQbwEMh8=V1; X-Resent-By: Forwarder X-Resent-For: rainer.schoepf@gmx.net X-Resent-To: rainer@rainer-schoepf.de Status: R X-Status: X-Keywords: X-UID: 7140 Hello Joel, > I’m following the LaTeX3 bug tracker, and saw the issue about > `\lua_now:x` being renamed to `\lua_now_x:n`. > > I suspect the explanation will be over my head, but since I haven't > seen this discussed on this list or explained in the l3 docs I figure > someone's got to ask: > > What's the difference between the `:x` signature and the `_x:n` > suffix+signature? We have recently been more careful about naming variants, so that `\foo_bar:x` is always equivalent to `\exp_args:Nx \foo_bar:n`. Some `x` variants are optimized, for instance `\use:x`, but this function is still equivalent to `\exp_args:Nx \use:n` in all cases. There are a few situations where primitives provide x-like expansion: at the moment I can think of - `\write` and `\immediate \write`, which expand the text to be written when they write it. - `\pdfstrcmp`, which expands two brace groups and compares the resulting strings. - `\directlua`, which expands one brace group before turing it to a string and passing it to Lua. The full expansion that is performed by those primitives is different from normal `x`-expansion in a subtle way. `\use:x { ...##... }` gives only one macro parameter token `#`, and `\use:x { ...#... }` is an error, while with engine `x`-like expansion, `\pdfstrcmp{#}{}` is valid. There is also a much more obvious difference: `x`-expansion cannot be done expandably, meaning that it may not appear within another `x`-expansion, while several of the primitives are expandable. We decided to denote this engine-level `x`-expansion by ending the name part with `_x`, and to use `:n` as a signature. There is a precedent for such an `:n` signature for functions which perform some expansion: `\int_eval:n` and most `int` functions, as well as `dim`, `skip`, `fp`, etc. The `\lua_now:x` function used to be a wrapper for `\directlua`, which means that it was expandable and had a slightly different behaviour than `\exp_args:Nx \lua_now:n` when `#` were involved. This convinced us that it was misnamed, so we changed the name to `\lua_now_x:n` after checking on TeXLive that the function was unused (both Joseph and I missed the lualatex-math code). We also provided `\lua_now:x` as a true `\exp_args:Nx` variant of `\lua_now:n`, hence it became protected (non-expandable). Since lualatex-math.sty relied on the expandability (it had to), it unfortunately broke. Kind regards, Bruno