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 r6H9hDJF011549 for ; Wed, 17 Jul 2013 11:43:14 +0200 Received: from relay.uni-heidelberg.de ([129.206.100.212]) by mx-ha.gmx.net (mxgmx011) with ESMTP (Nemesis) id 0MLjXP-1Uz70r3KeR-000uX3 for ; Wed, 17 Jul 2013 11:43:07 +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 r6H9eF7D020723 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 17 Jul 2013 11:40:16 +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 r6H8R8Oi000394; Wed, 17 Jul 2013 11:40:14 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 10287373 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Wed, 17 Jul 2013 11:40:14 +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 r6H9eEeY017609 for ; Wed, 17 Jul 2013 11:40:14 +0200 Received: from mail-ob0-f179.google.com (mail-ob0-f179.google.com [209.85.214.179]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id r6H9e0Ej023400 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=FAIL) for ; Wed, 17 Jul 2013 11:40:03 +0200 Received: by mail-ob0-f179.google.com with SMTP id xk17so2040382obc.10 for ; Wed, 17 Jul 2013 02:40:00 -0700 (PDT) X-Received: by 10.60.161.44 with SMTP id xp12mr7170789oeb.91.1374054000134; Wed, 17 Jul 2013 02:40:00 -0700 (PDT) MIME-Version: 1.0 Received: by 10.76.68.99 with HTTP; Wed, 17 Jul 2013 02:39:40 -0700 (PDT) References: Content-Type: text/plain; charset=ISO-8859-1 Message-ID: Date: Wed, 17 Jul 2013 11:39:40 +0200 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Michiel Helvensteijn Subject: Re: Request for argument specifiers which generate unique csnames To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE In-Reply-To: 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:DA6mWUw+Jww=:EV9FvmwDeygmE5g28oGh9A 0cq9S1XdnH6o79Iy02E/ahPN85OA4AgkIaQdBbGsHhbeblwkvqW5wpHH/yTPXzWB+kXFYZV CCqK/6ioNFHUICx7oV+MmTThN1gq+mBXrbJw6uzLgs0PC85z0SYUc+S7SwiYu2PV0oQ2j0x jluE+DqNzpmPMUdMCSkfM6PBYgNJHGRw06fCEW8py+NUFa7YhW/tqA3emNybOL8wKE4/nag vOm5q5XskBnS68Hl+r9etpoFOzUBRjbhb2yeHE8Tnp6uf0aLsAIWhXhBovFKCGCoW43t49P 1kd4USG0Jmgg4LnrEhWNUkT+ybJhYaHjZrl2hhGVDV3MSqtxOAoN1yK613xPKfxVhpUs/WJ q9qoQ73G2dxq3KL2D7yudCKM4LrDm/OyRvVU3RVjqdF2W10DeeekegJ8UnH1QV1JFKwlZEr QI/X+hkJKTL9D2KQV7YbQpYDYAYZMzJPRQcysmZg7A8OBf0KCLsrhDuoHzxyUAGRLoxh1WF HsK3cuZvi9xx5TMl48K/K8pZDMe+avmb08CQrgWqjitTASX8TxwXAvnftgz/l4cMpMRd0iL 9HdB1EDx5pg4Te0EMKZvqorZ/Uo7iMJcejiKeStDL61gSEZv1hZ9B3QeZgkYbXSrJhcwj7l Au6Ajrf1i9iZ08m03JI1SZHBMUG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, Bruno Le Floch wrote: > A: Argument specifiers and variants > =========================== > > Well, there are very many conditionals in expl3, and experience has > shown that the specifiers T and F are useful for visibility (they > would be even if we only provided the TF versions of conditionals and > not both T and F too). Oh, I love T and F. Slightly off-topic question: why are there no FT variants? I've encountered situations where it would have made the control flow a lot more readable. This is certainly not critical but also, I expect, quite painless to add. > What about D? Well, it would be more natural to label all of those > functions as :w and be done with it I don't see why it should be an argument specifier at all, since it says nothing about the arguments. Just use a notation outside the public interface conventions, like `\name::`. > A new variant type :Z > had better (1) alter "expl3 user"-accessible parts of TeX's memory as > little as possible, hence behave mostly as a pipe that takes some > tokens as an input and returns other tokens, (2) either be such that > most N-type arguments (all?) or most n-type arguments can be turned > into Z-type, (3) so far at least we only have variants which perform > some kind of expansion. Such requirements are fine so long as they serve a purpose other than "well, that's just how we do it". I agree that the 'purity' or 'side-effect freedom' of these variant types is a noble goal to strive for, but if more and more (legitimate) exceptions are made (such as :x and the fp-stuff), it becomes somewhat meaningless to hold on to this restriction and you'd be better off properly documenting and regulating side-effecting variants. Don't get me wrong though. I agree now that :u and :U should not be argument specifiers. I still think :r might make a nice one, but I do understand that you wouldn't add such a feature without evidence that people (other than just me) would find it useful. > If there was no alternative to providing an argument specifier :r, > then I might have been in favor of adding it. However, any > non-expandable specifier which is a variant of :n can be very well > approximated using a function that sets a temporary token list, then > using :o (or :V) expansion. Namely, if :Z (here, :r) is a variant of > :n, > > \foo:NnZx \a { AB } { ghi } > % is equivalent to > \tl_set:NZ \l_same_for_all_expansions_tl > \foo:Nnox \a { AB } \l_same_for_all_expansions_tl { ghi } But this is the case for :x too. > B: Baby-steps towards objects > ======================= I don't have time to process this section right now. But I will, because I'm very interested. >> \with:Vn \l_variable_tl { >> \bla:n { \do_not_expand_me bla bla bla #1 bla bla } >> } > > This situation does not need unique identifiers. Simply Oh, indeed. This was just a "hello world"-level example of `\with`. >> Here's how I currently implement my `\something_map_inline`s. I use >> the non-expl3 version of `\with`, because expl3 doesn't have :U. >> >> \cs_new_protected:Nn \something_map_inline:Nn { >> \with {Unn} [map_inline] [#2] { >> \cs_set:cpn {##1} ####1####2 {##2} >> \something_map_function:NN #1 {##1} >> } >> } > > I'm not fond of the fact that ##1 and ##2 in the body of \with are not > at all on the same footing, since ##1 is the unique name and ##2 is > the original #2. I don't understand. When are different parameters ever on the same footing? `\with` simply allows you to pass any 8 (expl3) or 7 (non-expl3) values, expanded however you like, into a block of code with one command. > Also, passing arbitrary parameters (here #2) > surrounded only be square brackets is very fragile, as it tends to > break if #2 contains some ]. Ah, easy enough to fix. ;-) \cs_new_protected:Nn \something_map_inline:Nn { \with {Un} [map_inline] [{#2}] { \cs_set:cpn {##1} ####1####2 ##2 \something_map_function:NN #1 {##1} } } > I see that, but I think the ptr package should actually be responsible > for building its own unique names. Well, if another package already encapsulates unique-name-creation, why reinvent the wheel? Best, -- www.mhelvens.net