Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) by h1439878.stratoserver.net (8.14.2/8.14.2/Debian-2build1) with ESMTP id r6C30Ccr007315 for ; Fri, 12 Jul 2013 05:00:13 +0200 Received: from relay2.uni-heidelberg.de ([129.206.210.211]) by mx-ha.gmx.net (mxgmx003) with ESMTP (Nemesis) id 0Li2La-1USDUj0lve-00n6Qb for ; Fri, 12 Jul 2013 05:00:07 +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 r6C2vVwc024874 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 12 Jul 2013 04:57:32 +0200 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 r6BM16WZ024333; Fri, 12 Jul 2013 04:57:31 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 10273226 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Fri, 12 Jul 2013 04:57:31 +0200 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 r6C2vUG8018673 for ; Fri, 12 Jul 2013 04:57:30 +0200 Received: from mail-vb0-f48.google.com (mail-vb0-f48.google.com [209.85.212.48]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id r6C2vL5B024851 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=FAIL) for ; Fri, 12 Jul 2013 04:57:24 +0200 Received: by mail-vb0-f48.google.com with SMTP id w15so1176180vbf.35 for ; Thu, 11 Jul 2013 19:57:21 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.52.191.72 with SMTP id gw8mr3167377vdc.114.1373597841110; Thu, 11 Jul 2013 19:57:21 -0700 (PDT) Received: by 10.52.27.47 with HTTP; Thu, 11 Jul 2013 19:57:20 -0700 (PDT) References: <51C94FA0.1080803@morningstar2.co.uk> <51DD0EBD.6080308@morningstar2.co.uk> <51DF2000.30703@morningstar2.co.uk> X-Google-Sender-Auth: rNn8hxsjXSy8zSPUfb7MuYkxG5g Content-Type: text/plain; charset=ISO-8859-1 Message-ID: Date: Thu, 11 Jul 2013 22:57:20 -0400 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Jura Pintar Subject: Re: l3keys feature request To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE In-Reply-To: <51DF2000.30703@morningstar2.co.uk> 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:s0bJ6DCuYQI=:G/2fRoJvbYCJ/mUy71c3lN FV6/Wjg4acFYYNGZxS7jLnPXbRB7LKiYyw6yTY/C5bb8zRenQplU7eLI5+p2b+V8/VQwVpM phjxWuDZe7gCsSDkdAvVo4v5zFe6vevnVB/QHyEVAL/J8Yv3xZVrDLe0bwqZcCmBVnU8x6R 4KZiyNvj4kRGWnOrTszyNaReb9z8XAbcxwBBChGVnEmg5gx4/DL9xXbvxf1A200myLGPhUg 4BwJlBFaPi4Z1PXExffOj1B2sT5t4DNBNXOU76yYXcOlfC8TDSvQ6OMadY9BaETM/sBuP3i jMX6FQR31qhYgMu45Jl5wlwDJwzEXGI5Z7BBKXB1HH+jfna0DastdVfbr7Jg8pubbzcsZcz SoIqz85UFxa4HxPiI/nlT6vAzw7IFb5IKdbFDX+SwCOIjmHrjkjfQOuzmNUvY20GVBFolEk dWm8BE2QCsYMUpKS8pt48WUwHUAP4NCh1TvxQK6Oze9IT1bzGeph1Wuy7PNo3iR3BP+IyUx 7OCmOpj1GHPAFtk8IIRQI3lbZXgBxVEFQnQSjz7ng+THVr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5oPwZQs5brn0= X-UI-Loop:V01:atrhmRfhdU0=:tKmpy8ZrbfXBdLGJsukprLMLt+DWTBfg+SBbGDMQKsc= Status: R X-Status: X-Keywords: X-UID: 7237 > My thinking with this is that you can simply do a 'filtered' or > 'grouped' setting without having to track when filtering is on/off. Yes, I did have a feeling that that bit was overkill given the limited purpose. > The above interface leaves open a few questions: > > - How is nesting handled? Does \keys_set:nn within > \keys_set_grouped:nnn respect groups? Does > \keys_set_grouped:nnn within \keys_set_grouped:nnn > work in a union or intersection way? I'd say, 'yes' to the first (that would be closest to what is done in pgfkeys), and given that, 'intersection' to the second. > - Do unknown keys raise an error, or are they ignored as they > are not in any group? Following pgfkeys again, I think they should raise an error. > - Do unused options need to be collected/available? I've not had the occasion to use this myself, but pgfkeys does provide it. One application that immediately pops to my mind is the control of key-setting order when the order is important, which is potentially rather useful. So why not have \keys_set_grouped:nnnN, allowing something like: \cs_new_protected:Npn \__mymodule_keys_set_in_order_and_do_something:n #1 { \keys_set_grouped:nnnN { mymodule } { must-be-set-first } {#1} \l__mymodule_keys_leftover_clist \__mymodule_do_something_first: \keys_set:nV { mymodule } \l__mymodule_keys_leftover_clist \__mymodule_do_something_else: } which is then used inside a document command. One could add an F branch to \clist_if_in:Nv inside \__keys_set_elt_grouped: that adds the expanded \l__keys_key_tl of the filtered keys to an \l__keys_filtered_clist and then \tl_set_eq:NN that to the last argument of \keys_set_groups:nnnN (\l__keys_filtered_clist should, naturally, be cleared somewhere, e.g. at the start of the new \__keys_set_grouped:nnnnnn). Another question is what should happen to keys that haven't been assigned a group. Right now, they're filtered out, but perhaps it would be better to set them. In that way, if there are keys that should never be filtered, they won't need to be assigned a fallback group to accomplish this. Pgfkeys provides both options, but it seems to me it's easier for package writers using l3keys to just follow the principle that they should assign a key to a group only if they ever want to filter it out. This ties in with one aspect of how the draft \keys_set_groups:nnn behaves that I feel should be definitely changed. Right now, when the second argument is empty, all the keys get set, which is the opposite of what one would expect. I think, instead, no keys should be set, except for those that have no group assigned to them. I believe changing \tl_set:Nx \l__keys_groups_clist {#4} to \tl_set:Nx \l__keys_groups_clist { , #4 } in the definition of \__keys_set_grouped:nnnnn would do this.