Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by h1439878.stratoserver.net (8.14.2/8.14.2/Debian-2build1) with ESMTP id r6CDqmGo009512 for ; Fri, 12 Jul 2013 15:52:49 +0200 Received: from relay.uni-heidelberg.de ([129.206.100.212]) by mx-ha.gmx.net (mxgmx112) with ESMTP (Nemesis) id 0M3631-1U8ylR1I6J-00sted for ; Fri, 12 Jul 2013 15:52:43 +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 r6CDnwQB001504 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 12 Jul 2013 15:49:58 +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 r6CDNkOr027440; Fri, 12 Jul 2013 15:49:57 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 10299337 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Fri, 12 Jul 2013 15:49:57 +0200 Received: from relay.uni-heidelberg.de (relay.uni-heidelberg.de [129.206.100.212]) by listserv.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id r6CDnuCb017443 for ; Fri, 12 Jul 2013 15:49:56 +0200 Received: from mail-ob0-f182.google.com (mail-ob0-f182.google.com [209.85.214.182]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id r6CDnenT001110 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=FAIL) for ; Fri, 12 Jul 2013 15:49:44 +0200 Received: by mail-ob0-f182.google.com with SMTP id va7so11167112obc.41 for ; Fri, 12 Jul 2013 06:49:40 -0700 (PDT) X-Received: by 10.60.161.44 with SMTP id xp12mr3977995oeb.91.1373636980001; Fri, 12 Jul 2013 06:49:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.76.120.200 with HTTP; Fri, 12 Jul 2013 06:49:19 -0700 (PDT) Content-Type: text/plain; charset=windows-1252 X-MIME-Autoconverted: from quoted-printable to 8bit by listserv.uni-heidelberg.de id r6CDnuCb017444 Message-ID: Date: Fri, 12 Jul 2013 15:49:19 +0200 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Michiel Helvensteijn Subject: Request for argument specifiers which generate unique csnames To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by relay.uni-heidelberg.de id r6CDnwQB001504 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:4zV+XH7zH9M=:AwWQZhrTGudvcUpP0EhQjE wJnDBS5jv3Jd0puvmncA7U7Yxs+Urmhipj2bNmNuWwUGfE9qx/qFQ4jlLtLkVIjCJ04p0fv 0tBnwZK15ICtnfiIroprz/QkNdK5dnN8UjjwBefYYi7VHG6ZtR7PQJBzFoanBfUF1IW66w/ l0YEcZ3YK1CBKSPptEOvx0desdSAngpoWAL2H/XwpnkMpy7mLgTXt6rLMuXXwKDUR2vPdxr tx+Fpcgm3ypY23r60nrnfQZ1RmyzNI+zMzaCZhgkZMdeAq5oyhivJsdgSFrmUAacbvJA+Gk Kcem1OgsLpLI+bpfcfXA0HvJFqalw4ifKTDRT+dMB+xWH1rgEKQP3UXstWjvgUuY1Ul5DjJ cYrOKPs9AdpYsEZiqRxEYBRJD7YUxC8botsMlOsHMyMVN/deaHR/84SX9PkLuN90QLuXiLM lmXbKm5xOOLDRS/BNluDaxeRtzp7HvIOjE6T4S0c3qUgf7IWpG2PsfOLgYJD80zH2Vg9vdU kVX8lT0xpinixqtElk6J+kZ2TeckShD8GsyiEcedXpDmUXzjbXOMP5wQvG6S2gUrVy8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SaFJQ5L4=:oWhVqu/u8iLTMvOsIfZoTyZenLQoUsMqj1khk5YV4m0= Status: R X-Status: X-Keywords: X-UID: 7240 Hello all, I have found it useful in my recent work to have unique csnames generated automatically. For example, when implementing a `\something_map_inline:Nn` from an existing `\something_map_function:NN`, there is the need to automatically generate a function from the provided loop body. It is not possible to keep using the same control sequence over and over, because that would make it impossible to do any nesting. I am thinking about argument specifiers: :U and :u Their actual parameters are a variable and variable-name respectively, which will contain the uniquely generated csname. The formal parameter in both cases is the uniquely generated control sequence (the cs, not the csname; same as with :N and :c). Here's an example of its use: \tl_new:N \l__something_map_csname_tl \cs_new_protected:Nn \something_map_inline:Nn { \cs_set:Upn \l__something_map_csname_tl ##1##2 {#2} \something_map_function:Nc #1 \l__something_map_csname_tl } Internally, I suspect it'll be easy enough to generate unique csnames. In my 'with' package (not in CTAN yet) I do it simply by increasing a counter (https://code.google.com/p/latex-with/source/browse/trunk/with.st= y). Obviously any function with a :U or :u argument is protected (as with :x). --- --- --- --- I now go one step further. The following idea is related to the above, but please evaluate them separately. It's about a third argument specifier that would go a long way towards solving the problem stated in [http://tex.stackexchange.com/questions/101833/latex3-how-to-get-reliable= -control-over-the-level-of-expansion]. Briefly, there is need for a simple and generally applicable technique to store user-supplied data and move it around =97with the guarantee that it is never expanded or modified=97 and then to return (pass as a parameter; leave in the input stream) said data exactly as it was received. Of course, there are already many ways to accomplish this, but they are always dependent on the situation (i.e. ad-hoc) and error-prone. I suggest another new argument specifier: :r The actual parameter is any kind of token-list (the 'user-supplied data'). The formal parameter is a uniquely generated csname to a macro containing that token-list: a "pointer" or "reference". Because of this extra level of redirection the pointer can be stored, moved around, expanded and dragged through the mud with relative certainty that the original data remains intact. The corresponding "dereference" specifiers already exist: :v and :c The first yields the data exactly as it was stored. The second yields a control sequence through which the data can be modified. Let me know what you think. -- www.mhelvens.net