Received: from mailout-de.gmx.net (mailout-de.gmx.net [213.165.64.22]) by h1439878.stratoserver.net (8.14.2/8.14.2/Debian-2build1) with SMTP id p2IBi8ex023749 for ; Fri, 18 Mar 2011 12:44:09 +0100 Received: (qmail 9452 invoked by uid 0); 18 Mar 2011 11:44:03 -0000 Delivered-To: GMX delivery to rainer.schoepf@gmx.net Received: from relay.uni-heidelberg.de ([129.206.100.212]) by mimp003 with uismtp id Lbjx1g00o4ax6kH01bjyNe; Fri, 18 Mar 2011 12:44:02 +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 p2IBflJi021706 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 18 Mar 2011 12:41:47 +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 p2IAOoEn011272; Fri, 18 Mar 2011 12:41:34 +0100 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 1216734 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Fri, 18 Mar 2011 12:41:34 +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 p2IBfY8G025330 for ; Fri, 18 Mar 2011 12:41:34 +0100 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.10]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id p2IBfTdj028793 for ; Fri, 18 Mar 2011 12:41:33 +0100 Received: from morse.mittelbach-online.de (p54A830AF.dip.t-dialin.net [84.168.48.175]) by mrelayeu.kundenserver.de (node=mrbap4) with ESMTP (Nemesis) id 0MeSlT-1QOyfP3nmJ-00Q7eU; Fri, 18 Mar 2011 12:41:29 +0100 Received: by morse.mittelbach-online.de (Postfix, from userid 501) id 2BCE072913; Fri, 18 Mar 2011 12:41:26 +0100 (CET) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit References: <905C5ED0-6639-4DEB-95AC-A2FCB2C4491D@gmail.com> <935A1EA2-C971-4A3A-8DF4-6F890E0CFB32@gmail.com> <5256FD2C-CD53-4FF0-A405-5B8B2781E5EC@gmail.com> X-Mailer: VM 7.19 under Emacs 21.3.1 X-Provags-ID: V02:K0:w0vTKiX1TB2TQhyvy1DqaO/kM+xxihqXfpfvYQtHmgC rpgAXrcOn8nZwVeozPSuIEAze0NGnL8715gBHx0+iWDx1S5JlF K3XTftzDBlE2t7il0iZx2zu1f87nQXxh/N0QTLSq4H2tdeplwA D/870plV47/d62jN9G5RKw/RJXqKY1r1gcCQzdlTVXxsEa93Cj SHsUhv0+qMVYrWXfiEcEA== X-Spam-Whitelist-Provider: Message-ID: <19843.17637.935263.780194@morse.mittelbach-online.de> Date: Fri, 18 Mar 2011 12:41:25 +0100 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Frank Mittelbach 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: ; Detail=5D7Q89H36p6v0AUTgaMO3gSMywNLDaHlEWQqLIHRmoVw1/vsOYSzoPAMx2jU8H7Fvp24p wu4sC5Tnr0OgMVCT8ee2AwsekHNT/lVTZS4gBnqRYwLAL+h2kz8hUBmUcGKxJPRRbIecqbIz94KVaC oglFWgwDhvn/XepD2iVmoUn26OZmBlqABmMRJanGPbig0aLEsQeddSuYsaDBvXBTPEw==V2 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: 6685 now that Bruno's code appears to be providing similar functionality as the old l3seq (at least to the extend of the test files we have) I would like to return/get to the proposed interface changes Bruno proposed > - items can be any balanced text, no brace will be stripped something we claimed but didn't actually do. > > - I don't like the fact that \seq_(g)pop return its value locally, so > I changed which functions are provided there to \seq_pop_with:Nn > {}. Im not sure here. - the general design principle is that all functions that get values from some data structure *always* store them *locally* in a variable. - the data structure itself could be local or global and a manipulation of the structure could then be local or global too. In my opinion this is a fairly simple rule and as far as programming requirements are concerned it covers essentially all that is necessary. (if one actually needs the value in some global variable then in the past one had to move it one but in practice so far we never had any occasion where this was necessary). On the other hand popping + using the value is a quite common usage, so to have to always write \seq_pop_left_with:Nn \l_foo_seq {\tl_set:Nn \l_bar_tl} instead of \seq_pop:NN \l_foo_seq \l_bar_tl ------------------------- now having written that I noticed that it isn't true, this is violated in l3prop where there are gget functions for key values, so hmmm ... still I tend towards the rule above I guess > - The mappings are fairly optimized as far as I can tell, and should > be preferred to doing things one element at a time. not sure what you mean here. clearly if you loop directly over a sequence then using mapping is preferable, but often when you do one element at a time the actions are complex so that they don't quite fit into a mapping function > > - I expect the pop_right functions to be much faster for large > sequences than simply storing the elements one by one. ??? > - I'd like every "..._map_function:NN" to become > "..._map_function:Nn", i.e. allow mapping several tokens at a time. It > isn't difficult to adapt the code for that, and it would be quite > practical, since among the mappings, only the "map_function" are > expandable. For that reason, "\seq_map_function:NN" is not defined in > the file I attach. Personally I don't find this very intuitive; if you map a function you map a function name and that would mean N. Besides you would lose the ability to map a constructed function name ie "c" though that is something you would seldom need I guess. If you map several tokens then this means that you either have a bunch of static tokens plus a final token/function that picks up the argument. Or alternatively you map a function with several arguments (and only the last one is filled with items from the sequence) or it is a mixture of both. None of those scenarios feel right to me. From a programming aspect I would probably always prefer to define my mapping function properly first and then apply it, ie instead of ...map_function:Nn \l_foo_seq { \func:n } I would rather do \cs_new:Npn \map_func:n #1 { \func:n #1} ...map_function:NN \l_foo_seq \map_func:n This has to be done anyway if the #1 needs to be somewhere other than at the end, eg \cs_new:Npn \map_func:n #1 {\func:nnn {foo}{#1}{bar}} or what kind of application did you have in mind for ...map_function:Nn ? my 2 cents frank