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 p2DMsIeI032226 for ; Sun, 13 Mar 2011 23:54:19 +0100 Received: (qmail 4464 invoked by alias); 13 Mar 2011 22:54:13 -0000 Delivered-To: GMX delivery to rainer.schoepf@gmx.net Received: (qmail invoked by alias); 13 Mar 2011 22:54:12 -0000 Received: from relay2.uni-heidelberg.de (EHLO relay2.uni-heidelberg.de) [129.206.210.211] by mx0.gmx.net (mx111) with SMTP; 13 Mar 2011 23:54:12 +0100 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [129.206.100.94]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id p2DMqK20004153 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 13 Mar 2011 23:52:21 +0100 Received: from listserv.uni-heidelberg.de (localhost.localdomain [127.0.0.1]) by listserv.uni-heidelberg.de (8.13.1/8.13.1) with ESMTP id p2DAHdXS014519; Sun, 13 Mar 2011 23:52:19 +0100 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 1209135 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Sun, 13 Mar 2011 23:52:19 +0100 Received: from relay.uni-heidelberg.de (relay.uni-heidelberg.de [129.206.100.212]) by listserv.uni-heidelberg.de (8.13.1/8.13.1) with ESMTP id p2DMqJYx025391 for ; Sun, 13 Mar 2011 23:52:19 +0100 Received: from mail-iw0-f177.google.com (mail-iw0-f177.google.com [209.85.214.177]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id p2DMqDbi015030 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=FAIL) for ; Sun, 13 Mar 2011 23:52:17 +0100 Received: by iwn36 with SMTP id 36so7349241iwn.22 for ; Sun, 13 Mar 2011 15:52:12 -0700 (PDT) Received: by 10.42.133.7 with SMTP id f7mr5691241ict.461.1300056732532; Sun, 13 Mar 2011 15:52:12 -0700 (PDT) Received: from [10.0.1.105] (114-30-104-175.ip.adam.com.au [114.30.104.175]) by mx.google.com with ESMTPS id wu1sm1975114icb.22.2011.03.13.15.52.09 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 13 Mar 2011 15:52:11 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii References: <905C5ED0-6639-4DEB-95AC-A2FCB2C4491D@gmail.com> <935A1EA2-C971-4A3A-8DF4-6F890E0CFB32@gmail.com> X-Mailer: Apple Mail (2.1081) X-Spam-Whitelist: Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by listserv.uni-heidelberg.de id p2DMqJYx025392 Message-ID: <5256FD2C-CD53-4FF0-A405-5B8B2781E5EC@gmail.com> Date: Mon, 14 Mar 2011 09:22:05 +1030 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Will Robertson Subject: Re: expl3's seq_pop_right etc. To: LATEX-L@listserv.uni-heidelberg.de In-Reply-To: <935A1EA2-C971-4A3A-8DF4-6F890E0CFB32@gmail.com> Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: X-GMX-Antispam: 0 (Mail was not recognized as spam); Detail=5D7Q89H36p6i75npGen84eVAEFK/syJmFuaL1OLtauwJ5R/kaZ9HAe8peGX1DeqJL7BW4 1X28hmBsSaikXt0ebYfUaHmtXkk7HChP+4IT8tI+yodefY66PMpp/kPudTSzX7BVqDxUGU4uAf/y ckanA==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: 6672 On 14/03/2011, at 8:44 AM, Will Robertson wrote: > So I'm generally in favour of this suggestion. But I wonder if there is some downside to using braces that I'm not experienced enough to see. (I can't think off the top of my head of another stack-like data structures in TeX that uses braces.) Can anyone comment further on this? Well, to answer my own question, here's a function I'm currently using in an expl3 translation of the NFSS: (sorry for the long-ish code chunk) % \begin{function}{\seq_map_inline:Npn} % \begin{syntax} % "\seq_map_inline:Npn" % \end{syntax} % Applies the to each element of % using delimited arguments defined by . % % Note that each element is internally delimited so argument matching % will be `greedy': writing "\seq_map_inline:Npn \foo #1,#2 {[#1,#2]}" % for element "abc,def" will print `[abc,def]'. Which may or may not seem % natural to you, depending how familiar you are with \TeX's delimited % arguments. % % For this reason this function is not broadly advertised ":)" % \end{function} % % % \begin{macro}{\seq_map_inline:Npn} % When a "seq" contains multiple pieces of information. % (Perhaps I should be using a "prop" instead; to consider!) % \begin{macrocode} \cs_new_protected_nopar:Npn \seq_map_inline:Npn #1#2# { \seq_map_inline_aux:Nnn #1 {#2} } \cs_new:Npn \seq_map_inline_aux:Nnn #1#2#3 { \cs_set:Npn \seq_elt:w #2 \seq_elt_end: {#3} #1 \use_none:n \q_stop \cs_set_eq:NN \seq_elt:w \ERROR } % \end{macrocode} % \end{macro} Now you could argue that I'm using the wrong data structure here (perhaps a property list would be better) but there you go. I'm not certain we want to support this kind of use, but the current delimited structure of "seq"s sure has come in handy in this particular situation. Will