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 p2DNhLWr017673 for ; Mon, 14 Mar 2011 00:43:22 +0100 Received: (qmail 10586 invoked by alias); 13 Mar 2011 23:43:16 -0000 Delivered-To: GMX delivery to rainer.schoepf@gmx.net Received: (qmail invoked by alias); 13 Mar 2011 23:41:36 -0000 Received: from relay.uni-heidelberg.de (EHLO relay.uni-heidelberg.de) [129.206.100.212] by mx0.gmx.net (mx038) with SMTP; 14 Mar 2011 00:41:36 +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 p2DNdgAG024056 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 14 Mar 2011 00:39:42 +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 p2DN14s5027001; Mon, 14 Mar 2011 00:39:40 +0100 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 1205136 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Mon, 14 Mar 2011 00:39:40 +0100 Received: from relay2.uni-heidelberg.de (relay2.uni-heidelberg.de [129.206.210.211]) by listserv.uni-heidelberg.de (8.13.1/8.13.1) with ESMTP id p2DNde31030153 for ; Mon, 14 Mar 2011 00:39:40 +0100 Received: from mail-gw0-f49.google.com (mail-gw0-f49.google.com [74.125.83.49]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id p2DNdYQf013278 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=FAIL) for ; Mon, 14 Mar 2011 00:39:39 +0100 Received: by gwb1 with SMTP id 1so2867128gwb.22 for ; Sun, 13 Mar 2011 16:39:34 -0700 (PDT) Received: by 10.150.246.6 with SMTP id t6mr5187122ybh.251.1300059574234; Sun, 13 Mar 2011 16:39:34 -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 d3sm4913877ybi.17.2011.03.13.16.39.31 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 13 Mar 2011 16:39:33 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1081) References: <905C5ED0-6639-4DEB-95AC-A2FCB2C4491D@gmail.com> <935A1EA2-C971-4A3A-8DF4-6F890E0CFB32@gmail.com> <5256FD2C-CD53-4FF0-A405-5B8B2781E5EC@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 p2DNde31030154 Message-ID: Date: Mon, 14 Mar 2011 10:09:28 +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: Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: X-GMX-Antispam: 0 (Mail was not recognized as spam); Detail=5D7Q89H36p4U4jfdfC5HDevlx1X2sAZgP9e9F2VTUYI/FLDAh5vXTVin+wznIYULO4W8f iu4UIHVeutAdNYNyhIIRpjhB4NMqCt7OvFNAZ3Em9oZmuR2zOKGeZpAGdnSMvI6CR2LHXlIcSoSO ckeoA==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: 6675 Hi, A couple of replies in-line. On 14/03/2011, at 9:28 AM, Bruno Le Floch wrote: > Will's version (and I guess yours if you use > `\quark_if_recursion_tail_stop:n`) breaks for items like > {{{{{{a}}}}}}, or some cases with conditionals. So let me also propose > a fix for `\quark_if_recursion_tail_stop:n` and friends (see attached > for examples where the current version is broken, and for the fix). Whose version? :) I think Morten was the last person to significantly re-write l3seq -- nothing to do with me! I'm not so fussed about the edge cases with mismatched conditionals, but the {{{{{{a}}}}}} problem is more serious. I'll look into it. I haven't seen that catcode trick for comparing emptiness -- is it any better than \tl_if_empty ? On 14/03/2011, at 9:48 AM, Bruno Le Floch wrote: > 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. That's true; I guess the difference is negligible. > \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 Surely the break has to come at the end so that any \seq_map_break:n puts its argument after all the cleanup? (I only just fixed this up in the repository; \seq_map_break:n has been broken in this regard, I think, ever since I first added it. (I.e., not Morten's fault!)) This reminds me that after I implemented the break using a gobbling-up-until marker, I realised it would have been more in the spirit of the seq code to just define \cs_set:Npn \seq_elt:w #1 \seq_elt_end: {} and if you need to execute some code at the end to end the mapping with \seq_map_end: that was normally \prg_do_nothing: but could be redefined as necessary. Never got around to trying out the different versions; the above would be nice and simple. -- Will