Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) by h1439878.stratoserver.net (8.14.2/8.14.2/Debian-2build1) with ESMTP id r29F2bmN028581 for ; Sat, 9 Mar 2013 16:02:39 +0100 Received: from relay2.uni-heidelberg.de ([129.206.210.211]) by mx-ha.gmx.net (mxgmx001) with ESMTP (Nemesis) id 0MNIF7-1U7TXa420n-006uHP for ; Sat, 09 Mar 2013 16:02:32 +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 r29F0bfm008684 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 9 Mar 2013 16:00:38 +0100 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [127.0.0.1]) by listserv.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id r28N131P020153; Sat, 9 Mar 2013 16:00:37 +0100 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 8154799 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Sat, 9 Mar 2013 16:00:37 +0100 Received: from relay2.uni-heidelberg.de (relay2.uni-heidelberg.de [129.206.210.211]) by listserv.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id r29F0bf7024464 for ; Sat, 9 Mar 2013 16:00:37 +0100 Received: from smtp.demon.co.uk (mdfmta004.mxout.tbr.inty.net [91.221.168.45]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id r29F0I01008623 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 9 Mar 2013 16:00:23 +0100 Received: from mdfmta004.tbr.inty.net (unknown [127.0.0.1]) by mdfmta004.tbr.inty.net (Postfix) with ESMTP id A3B71A0C07F for ; Sat, 9 Mar 2013 15:00:18 +0000 (GMT) Received: from mdfmta004.tbr.inty.net (unknown [127.0.0.1]) by mdfmta004.tbr.inty.net (Postfix) with ESMTP id 80D58A0C073 for ; Sat, 9 Mar 2013 15:00:18 +0000 (GMT) Received: from palladium.local (unknown [80.176.134.7]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mdfmta004.tbr.inty.net (Postfix) with ESMTP for ; Sat, 9 Mar 2013 15:00:18 +0000 (GMT) User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130216 Thunderbird/17.0.3 MIME-Version: 1.0 References: X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-MDF-HostID: 9 Message-ID: <513B4E80.2070409@morningstar2.co.uk> Date: Sat, 9 Mar 2013 15:00:16 +0000 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Joseph Wright Subject: Re: Bug + fix for \prop_map_tokens:Nn To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE In-Reply-To: Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: Envelope-To: X-GMX-Antispam: 0 (Mail was not recognized as spam); Detail=V3; X-GMX-Antivirus: 0 (no virus found) X-UI-Filterresults: notjunk:1;V01:K0:j4vQUi5y5VI=:3R2fJDUSKTrhugS3TL9uOC OeOHh6asLEwWVtaloOFoLxdMNBzN9Wxy2TC8xPifwPIdCePNNj2AvL405YWO+2aARnAWgaZ y/VQMjTQPRfDCAmmJJaIQNOJRzyfX0SXxVJwAnZpY4qr11OO2fDNFgUOlrgvb/HGrfIGVG+ ZM0Kagmm2PyWwKKSNyDySsw8b3QcuiBTQq4cJz88ei+fx9gKGWBeyc6vHnD12midM+mV0ro TF+5cyWHpFprWmB4IGBC/eoie2JR5KUQ3XtNmTqIBKob95KOOTihrecIyZmcaRZifV3X6Kc VIwJ5J/Pb5mCVTnSgQqNGr2K4xbcyXdK5t0xKVAYZNgMu+iucTNemUFkk4w8B8de/GDJSxI C6W31F7rMtvtJjxMjuy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Loop:V01:L7IZ6bZ7sg0=:151L95xh7JL/Nm3lyMzquWr+oVT9Pi8GwgsKBVfolCY= Status: R X-Status: X-Keywords: X-UID: 7185 On 09/03/2013 11:55, Michiel Helvensteijn wrote: > Hi all, > > I encountered a bug in the \prop_map_tokens:Nn function in l3candidates.dtx. > > Here's a not-working minimal example: > > ---------------------------------------- > \ExplSyntaxOn > \cs_set:Nn \test_mapper:nn > { (#1,~#2)~ } > \prop_new:N \testprop > \prop_put:Nnn \testprop {1} {v1} > \prop_put:Nnn \testprop {222} {v2} > \prop_put:Nnn \testprop {3} {v3} > \prop_put:Nnn \testprop {4} {v4} > \prop_map_tokens:Nn \testprop { \test_mapper:nn } > \ExplSyntaxOff > ---------------------------------------- > > The output will be: > > ---------------------------------------- > (1, v1)2 > ---------------------------------------- > > It only processes single-token keys correctly. At the first > multi-token key, everything except for its first two tokens are > processed directly, then the rest of the list is skipped. > > Here's the fix for l3candidates.dtx: > > ---------------------------------------- > \cs_new:Npn \@@_map_tokens:nwn #1 \q__prop #2 \q__prop #3 > { > \__quark_if_recursion_tail_break:nN {#2} \prop_map_break: > \use:n {#1} {#2} {#3} > \@@_map_tokens:nwn {#1} > } > ---------------------------------------- > > It just changes the tail-break test from :NN to :nN and adds braces around #2. > > Cheers! The full fix is actually a bit more involved as using \__quark_if_recursion_tail_break:nN will give the wrong result if your key is called \q_recursion_tail. In the SVN, this is fixed and I've also added a test. I'm expecting to do a CTAN update very soon: I just need to wait for one third party to update their package on CTAN (so we don't break documents). -- Joseph Wright