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 p2DNLHkP009674 for ; Mon, 14 Mar 2011 00:21:18 +0100 Received: (qmail 12846 invoked by alias); 13 Mar 2011 23:21:12 -0000 Delivered-To: GMX delivery to rainer.schoepf@gmx.net Received: (qmail invoked by alias); 13 Mar 2011 23:21:12 -0000 Received: from relay.uni-heidelberg.de (EHLO relay.uni-heidelberg.de) [129.206.100.212] by mx0.gmx.net (mx088) with SMTP; 14 Mar 2011 00:21:12 +0100 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 p2DNInZY020470 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 14 Mar 2011 00:18:49 +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 p2DN14rl027001; Mon, 14 Mar 2011 00:18:41 +0100 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 1205118 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Mon, 14 Mar 2011 00:18:41 +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 p2DNIfiB029022 for ; Mon, 14 Mar 2011 00:18:41 +0100 Received: from mail-yw0-f49.google.com (mail-yw0-f49.google.com [209.85.213.49]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id p2DNIaDt020416 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=FAIL) for ; Mon, 14 Mar 2011 00:18:40 +0100 Received: by ywa8 with SMTP id 8so3373696ywa.22 for ; Sun, 13 Mar 2011 16:18:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.150.93.18 with SMTP id q18mr5247665ybb.207.1300058315870; Sun, 13 Mar 2011 16:18:35 -0700 (PDT) Received: by 10.147.170.13 with HTTP; Sun, 13 Mar 2011 16:18:35 -0700 (PDT) References: <905C5ED0-6639-4DEB-95AC-A2FCB2C4491D@gmail.com> <935A1EA2-C971-4A3A-8DF4-6F890E0CFB32@gmail.com> <5256FD2C-CD53-4FF0-A405-5B8B2781E5EC@gmail.com> Content-Type: text/plain; charset=ISO-8859-1 X-Spam-Whitelist: Message-ID: Date: Sun, 13 Mar 2011 19:18:35 -0400 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Bruno Le Floch Subject: Re: expl3's seq_pop_right etc. To: LATEX-L@listserv.uni-heidelberg.de In-Reply-To: <5256FD2C-CD53-4FF0-A405-5B8B2781E5EC@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=5D7Q89H36p77e5KAPs1l6v/Sb97LojnDtMgfETrECMLUO9erHzOJe+OynZRhvlGqb5A0X bbiCt2rAnnct/NAlbHMvoAL6GY+23tB3khNK7bp7qqSbssdDTHsQd8+gWzfjr4OMj5ambWQGofKK 3vIsQ==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: 6674 >> 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) It is very easy to convert from the braced to the delimited version using \cs_set:Npn \seq_elt:n #1 {\seq_elt:w #1 \seq_elt_end:} See code below for the full code corresponding to what you wrote. \RequirePackage{expl3} \ExplSyntaxOn % Assuming seqs of the form \tl_new:Nn \l_foo_Seq {\seq_elt:n {a/b-c} \seq_elt:n {A/BC-DE}} % We can always convert back to the old form using \cs_new:Npn \seq_elt_new_to_old:n #1 {\seq_elt:w #1 \seq_elt_end:} % "\Seq_map_inline:Npn" \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_eq:NN \seq_elt:n \seq_elt_new_to_old:n \cs_set:Npn \seq_elt:w #2 \seq_elt_end: {#3} #1 \use_none:nnn \seq_elt_end: \q_break {} % break in the "new" way. \cs_set_eq:NN \seq_elt:w \ERROR \cs_set_eq:NN \seq_elt:n \ERROR } % Example \tl_set:Nn \l_foo_Seq {\seq_elt:n {a/b-c} \seq_elt:n {A/BC-DE}} \Seq_map_inline:Npn \l_foo_Seq #1/#2-#3 {\tl_show:n {#1|#2|#3}} -- Bruno