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 p7MAgvxu014256 for ; Mon, 22 Aug 2011 12:43:03 +0200 Received: (qmail 21412 invoked by alias); 22 Aug 2011 10:42:52 -0000 Delivered-To: GMX delivery to rainer.schoepf@gmx.net Received: (qmail invoked by alias); 22 Aug 2011 10:42:51 -0000 Received: from relay2.uni-heidelberg.de (EHLO relay2.uni-heidelberg.de) [129.206.210.211] by mx0.gmx.net (mx099) with SMTP; 22 Aug 2011 12:42:51 +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 p7MAeELS028762 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 22 Aug 2011 12:40:15 +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 p7M9FrNQ029851; Mon, 22 Aug 2011 12:40:14 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 1562820 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Mon, 22 Aug 2011 12:40:14 +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 p7MAeEow027643 for ; Mon, 22 Aug 2011 12:40:14 +0200 Received: from ueamailgate01.uea.ac.uk (ueamailgate01.uea.ac.uk [139.222.131.184]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id p7MAe1pF028696 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 22 Aug 2011 12:40:05 +0200 Received: from ueams02.uea.ac.uk (ueams02.uea.ac.uk [139.222.131.131]) by ueamailgate01.uea.ac.uk (8.13.8/8.13.8) with ESMTP id p7MAe1lM018549 for ; Mon, 22 Aug 2011 11:40:01 +0100 Received: from [139.222.114.131] by ueams02.uea.ac.uk with esmtp (Exim 4.69) (envelope-from ) id 1QvRuR-0008BZ-Nt for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Mon, 22 Aug 2011 11:39:11 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:6.0) Gecko/20110812 Thunderbird/6.0 MIME-Version: 1.0 References: <4E4FF538.7070601@morningstar2.co.uk> <9788A2B7-3E8F-4D2C-A52E-10999BCB59FA@gmail.com> <4E516DF2.4040002@morningstar2.co.uk> <104nbkj0nr84x.dlg@nililand.de> X-Enigmail-Version: 1.3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN, outgoing) X-CanIt-Geo: ip=139.222.131.131; country=GB; region=I9; city=Norwich; latitude=52.6333; longitude=1.3000; http://maps.google.com/maps?q=52.6333,1.3000&z=6 X-CanItPRO-Stream: UEA:outgoing (inherits from UEA:default,base:default) X-Canit-Stats-ID: 05FnmE1Tg - 414aea5a361c - 20110822 X-Scanned-By: CanIt (www . roaringpenguin . com) on 139.222.131.184 Message-ID: <4E523217.2080408@morningstar2.co.uk> Date: Mon, 22 Aug 2011 11:40:23 +0100 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Joseph Wright Subject: Re: couple of l3keys notes To: LATEX-L@listserv.uni-heidelberg.de In-Reply-To: <104nbkj0nr84x.dlg@nililand.de> Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: X-GMX-Antispam: 0 (eXpurgate); Detail=5D7Q89H36p6scdPqt3b0GISnHn9U+AQsqxtsgt0SRw5iPL4AzcMVVmlq5Z4cqMB0qIpY1 QlrTiAclXO2iiumWyEYPe/d8M7wIqXrZVNn07wzz0YmnXIC3rSTsVzVnEaIsDmwxTo4Sz9TLH0CN hpVz4FeOwigF6uBmL6GI4s+rp44JaX6PNUJwGodl5uc5z35uFTrtMI7TzY=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: 6818 On 22/08/2011 09:05, Ulrike Fischer wrote: > In chessboard I use the xkeyval feature to pass remaining keys to > order the processing: I have three types of keys: initialization, > setting properties of the board, filling the board which must be > processed in this order. > > So I'm using something like this > \def\chessboard #1 { > \setkeys* {init} {#1} > \setrmkeys*{set} {#1} > \setrmkeys {fill} {#1} > > The main difference in this approach compared to three simple > \setkeys commands are in the *: It means that unknown keys will > pass the first setkeys but the last \setrmkeys command will give an > error if there remains a key unknown. Can this be done with l3keys? Currently this can be done only using an approach similar to the one Will outlined, for example \keys_define:nn { chess / init } { unknown .code:n = { \chess_keys_filter:n {#1} } } \keys_define:nn { chess / set} { unknown .code:n = { \chess_keys_filter:n {#1} } } \cs_new_protected:Nn \chess_keys_filter:n { \clist_put_right:Nx \l_chess_keys_leftover_clist { \l_keys_key_tl = { \exp_not:n {#1} } } } \cs_new_protected:Nn \chess_keys_set:nn { \clist_clear:N \l_chess_keys_leftover_clist \keys_set:nn { chess /#1 } {#2} } \cs_generate_variant:Nn \chess_keys_set:nn { nV } \cs_new_protected:Npn \chessboard #1 { \chess_keys_filter:nn { init } {#1} \chess_keys_filter:nV { set } \l_chess_keys_leftover_clist \keys_set:nV { chess / fill } \l_chess_keys_leftover_clist } where the fact that "unknown .code:n" is not set for "chess / fill" means that the standard unknown routine (i.e. an error) still applies. Now while this is okay, the point I guess is that a cleaner interface is desirable. One simple approach would be to define \keys_set_known:nn, which does the same as \keys_set:nn but (a) raises no error for unknown keys and (b) stores unknowns in some defined place. This might lead to \keys_set_known:nn { chess / init } {#1} \keys_set_known:nV { chess / set } \l_keys_unknown_keyvals_clist \keys_set:nV { chess / fill } \l_keys_unknown_keyvals_clist (I'm imagining \l_keys_unknown_keyvals_clist contains the keys plus values, with \l_keys_unknown_keys_clist just containing the key names.) An obvious question then is whether to provide an 'internal' recycle, similar to \setrmkeys, or just to provide the list as a variable and leave it to the programmer to do the recycling. -- Joseph Wright