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 p3FMM79m001473 for ; Sat, 16 Apr 2011 00:22:09 +0200 Received: (qmail 5831 invoked by alias); 15 Apr 2011 22:22:02 -0000 Delivered-To: GMX delivery to rainer.schoepf@gmx.net Received: (qmail invoked by alias); 15 Apr 2011 22:22:02 -0000 Received: from relay2.uni-heidelberg.de (EHLO relay2.uni-heidelberg.de) [129.206.210.211] by mx0.gmx.net (mx117) with SMTP; 16 Apr 2011 00:22:02 +0200 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 p3FMJgUM005738 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 16 Apr 2011 00:19:43 +0200 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 p3FM16U2024658; Sat, 16 Apr 2011 00:19:42 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 1205402 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Sat, 16 Apr 2011 00:19:42 +0200 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 p3FMJf29027403 for ; Sat, 16 Apr 2011 00:19:41 +0200 Received: from mail-gx0-f177.google.com (mail-gx0-f177.google.com [209.85.161.177]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id p3FMJaAZ005700 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=FAIL) for ; Sat, 16 Apr 2011 00:19:41 +0200 Received: by gxk2 with SMTP id 2so1976977gxk.22 for ; Fri, 15 Apr 2011 15:19:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.236.26.34 with SMTP id b22mr1409351yha.201.1302905976019; Fri, 15 Apr 2011 15:19:36 -0700 (PDT) Received: by 10.147.136.4 with HTTP; Fri, 15 Apr 2011 15:19:35 -0700 (PDT) References: <4DA5C4E2.8090005@morningstar2.co.uk> <58AFBC3A-4209-4BC0-BB3A-5B14D6B5EFD8@gmail.com> <4DA727A9.2050903@morningstar2.co.uk> <19880.45400.677093.956908@morse.mittelbach-online.de> Content-Type: text/plain; charset=ISO-8859-1 X-Spam-Whitelist: Message-ID: Date: Fri, 15 Apr 2011 18:19:35 -0400 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Bruno Le Floch Subject: Re: The nature of popping from an empty sequence To: LATEX-L@listserv.uni-heidelberg.de In-Reply-To: <19880.45400.677093.956908@morse.mittelbach-online.de> Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: X-GMX-Antispam: 0 (eXpurgate); Detail=5D7Q89H36p6HRL9CJLUCw+qCfRO7IcZX7jZKglfNtKLKCVdvKaPsx9GjBtDF+wFGkDl6j NKPtGiolNBJOHaVSehFUJ29USYvPcrAPRz3H/zKz9I3Ca726XfEwEZmRRa/kGgcfsWN4oNH9h3bS /rREZzp+U7u6R+4aa+gLtpOs239Y9+Si5EXQdr8Uflx0fcpBEZwsKOM0COPRPJzRF3ZSg==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: 6709 > I wonder if \prop_if_in:Nn(TF) isn't expandable (or rather could be made so, > right now it is a protected conditional (for good)). If so then the fact > that it is slower would be ok. I haven't tried, but one could probably build an > expandable if_in as well - whether that's worth the effort is a differnt > matter. See below for an expandable if_in. However, it compares keys with \str_if_eq:nn (to be expandable), so that imposes restrictions on keys. I feel like it is not a huge restriction for practical applications, but I may be wrong. I would say that keys should be stored as is, but compared as strings. > Otherwise, if could be implemented by using internally get > with some internal variable. In the latter cases it would be equally fast > but fairly useless. The only difference being that you don#t have to > unnecessarily specify a variable name you aren't using. I prefer having an expandable test (with the string caveat explained above). Right now, if_in is implemented with prop_split_aux, exactly like prop_get, plus an extra \quark_...:nTF test. Probably slower than using prop_get and \quark_...:NTF. Regards, Bruno % I don't like much the fact that breaks are delimited by \q_stop. % It should be a special \q_break, or not even a quark. % \cs_new_eq:NN \prop_map_break:n \use_i_delimit_by_q_stop:nw \cs_new:Npn \use_ii_i:nn #1 #2 { #2 #1 } \prg_set_conditional:Npnn \prop_if_in:Nn #1 #2 {p,T,F,TF} { \exp_after:wN \use_ii_i:nn \exp_after:wN {\toks_use:N #1} { \prop_if_in_aux:nNwn {#2} } { ? \prop_map_break:n { \prg_return_false: } } \q_prop { } % dummy arguments for the last \prop_if_in_aux:nNwn \q_stop } \cs_new:Npn \prop_if_in_aux:nNwn #1 #2 #3 \q_prop #4 { \use_none:n #2 % most often #2=\q_prop, except the last time \str_if_eq:nnT {#1} {#3} { \prop_map_break:n {\prg_return_true:} } \prop_if_in_aux:nNwn {#1} } % It is possible to use a similar approach (\use_none:n #2 with #2 being % either one token or, at the end, more) to improve \prop_map_function:NN.