Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by h1439878.stratoserver.net (8.14.2/8.14.2/Debian-2build1) with ESMTP id r5PL6RD5001634 for ; Tue, 25 Jun 2013 23:06:28 +0200 Received: from relay2.uni-heidelberg.de ([129.206.210.211]) by mx-ha.gmx.net (mxgmx110) with ESMTP (Nemesis) id 0LubL2-1U9pYk0hg8-00zpoC for ; Tue, 25 Jun 2013 23:06:22 +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 r5PL36xC010755 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 25 Jun 2013 23:03:06 +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 r5PE1hBU002777; Tue, 25 Jun 2013 23:03:05 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 10087993 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Tue, 25 Jun 2013 23:03:05 +0200 Received: from relay.uni-heidelberg.de (relay.uni-heidelberg.de [129.206.100.212]) by listserv.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id r5PL35BE012415 for ; Tue, 25 Jun 2013 23:03:05 +0200 Received: from mail-vb0-f46.google.com (mail-vb0-f46.google.com [209.85.212.46]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id r5PL2p7R014924 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=FAIL) for ; Tue, 25 Jun 2013 23:02:54 +0200 Received: by mail-vb0-f46.google.com with SMTP id 10so9981150vbe.19 for ; Tue, 25 Jun 2013 14:02:50 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.58.249.236 with SMTP id yx12mr531352vec.25.1372194170624; Tue, 25 Jun 2013 14:02:50 -0700 (PDT) Received: by 10.52.96.36 with HTTP; Tue, 25 Jun 2013 14:02:50 -0700 (PDT) References: <51C94FA0.1080803@morningstar2.co.uk> Content-Type: text/plain; charset=ISO-8859-1 Message-ID: Date: Tue, 25 Jun 2013 17:02:50 -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: <51C94FA0.1080803@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:d6/5lbCnSWA=:uGp4X3z2Tj5TH3KD5RhP/h gasagTYH75XgIaUg7XPGswDhczL1zeEhtkMSnqd+NUi3IdT5N+nOsO95zFgeb71LlM8/Eg8 5+Jn+WxviqfcfWJ5x/fETOpAH1lsqEtA+TbEej42CzaBG19JessUwMj/tg8EKm6pHabmtD8 kYv4KfFl2+AKi5GNBXMG5UHzSbnmbuwZZfGEnuf8pZrebN9hXvZmZVgZW+uH/GaxTWU1U/I oZsKUhFtvag0rbHOedgs6g213W7LgG5zLuqyKQD573W0+OZKTtL/UuUjzhGG1PaHHTKVcKX zGjaAgTfPM7Ny8CBAEbHCPyVPgDz1xRTjG/ECS8FgugZIy+ibtmnM4DMa9brv1aG0DBaOt6 2KZs/Ufl2u7ij/ChN4PbfRdOWmBhJMMWNUWvE2d4A+NB5MJ0adrUYi55tvjzMw3PdEaSMIP nQxPJXcsITvsttzR5s9M/HhNSmuH8PSkhBS72+QDGFwi08dt2bP+YDe23JxP6WtogmtuVPt WN8nw+8EvltfZoVZolU27zrrtThEaM9fkxtEvUahKcXBnIkZVKb02zuHmH7IGi6tpbpol3G d2+AKaVIXSJNc4P7xZjqzeCkj9YoGG3coetNgdFgwlGWKgoYGuRGnveQ6TEzNs3QlugLny3 i/ZaLXQT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ain, both in functionality and name terms. I wonder if > we might have a real-life use case for this? I certainly feel no close attachment to the proposed names! :) They were just the first to pop into my mind. Perhaps \keys_subgroups_set:nnn (\keys_subgroups_set_known:nnn) or even just \keys_set:nnn (\keys_set_known:nnn) would be better. You'd be the best judge of what the closest fit with the current naming scheme is. The way I see it, these commands would be a replacement of sorts for \pgfkeysactivatefamilies{}{} followed by \pgfqkeysfiltered{}{} and their kin. Let's say we wanted to define some user commands that take a key-value list as an argument, but each command should accept a different subset of the available keys. With pgfkeys (and L2) we could do \pgfkeys{ /mymodule/.cd, subgroup-A/.is family, subgroup-B/.is family, subgroup-C/.is family, key-A-i/.code={}, key-A-i/.belongs to family={/mymodule/subgroup-A}, ... key-B-i/.code={}, key-B-i/.belongs to family={/mymodule/subgroup-B}, ... key-C-i/.code={}, key-C-i/.belongs to family={/mymodule/subgroup-C}, ... } \pgfkeysinstallkeyfilter{ /pgf/key filters/active families }{} \DeclareDocumentCommand\fooABC{ m }{% \pgfqkeys{/mymodule}{#1}% \mymodule@fooABC% } \DeclareDocumentCommand\fooAB{ m }{% \pgfkeysactivatefamilies{ /mymodule/subgroup-A, /mymodule/subgroup-B }{\mymodule@AB@filter@stop}% \pgfqkeysfiltered{/mymodule}{#1}% \mymodule@fooAB% \mymodule@AB@filter@stop% } \DeclareDocumentCommand\fooBC{ m }{% \pgfkeysactivatefamilies{ /mymodule/subgroup-B, /mymodule/subgroup-C }{\mymodule@BC@filter@stop}% \pgfqkeysfiltered{/mymodule}{#1}% \mymodule@fooBC% \mymodule@BC@filter@stop% } With the proposed commands, we could do the same in l3keys by writing \keys_define:nn { mymodule } { subgroup-A / key-A-i .code:n = { } , ... subgroup-B / key-B-i .code:n = { } , ... subgroup-C / key-C-i .code:n = { } , ... } \DeclareDocumentCommand \fooABC { m } { \keys_subgroups_set_known:nnnN { mymodule } { subgroup-A , subgroup-B , subgroup-C } {#1} \l__mymodule_tmp_clist \__mymodule_fooABC: } \DeclareDocumentCommand \fooAB { m } { \keys_subgroups_set_known:nnnN { mymodule } { subgroup-A , subgroup-B } {#1} \l__mymodule_tmp_clist \__mymodule_fooAB: } \DeclareDocumentCommand \fooBC { m } { \keys_subgroups_set_known:nnnN { mymodule } { subgroup-B , subgroup-C } {#1} \l__mymodule_tmp_clist \__mymodule_fooBC: } Right now, to achieve this we would need to write something like \DeclareDocumentCommand \fooABC { m } { \keys_set_known:nnN { mymodule / subgroup-A } {#1} \l__mymodule_tmp_clist \keys_set_known:noN { mymodule / subgroup-B } { \l__mymodule_tmp_clist } \l__mymodule_tmp_clist \keys_set_known:noN { mymodule / subgroup-C } { \l__mymodule_tmp_clist } \l__mymodule_tmp_clist \__mymodule_fooABC: } \DeclareDocumentCommand \fooAB { m } { \keys_set_known:nnN { mymodule / subgroup-A } {#1} \l__mymodule_tmp_clist \keys_set_known:noN { mymodule / subgroup-B } { \l__mymodule_tmp_clist } \l__mymodule_tmp_clist \__mymodule_fooAB: } \DeclareDocumentCommand \fooBC { m } { \keys_set_known:nnN { mymodule / subgroup-B } {#1} \l__mymodule_tmp_clist \keys_set_known:noN { mymodule / subgroup-C } { \l__mymodule_tmp_clist } \l__mymodule_tmp_clist \__mymodule_fooBC: } We could, of course, define a \__mymodule_keys_subgroups_set:nnn command, that would map the clist of subgroups and use \keys_set_known:nnN inside, with only the minimal overhead of an extra pair of of \cs_set_eq:NN on each iteration, but I do feel adding a kernel command would be the more elegant solution here. I have a real-life-use example to offer, too. I've been working on a new and much expanded version of the turnstile package (http://www.ctan.org/pkg/turnstile). Two notable the features of this new version are its ability to have turnstile symbols match the designs of a number of specified maths typefaces, and its ability to produce the full range of Unicode-recognised turnstiles (plus a few extras, like an extensible |~). And there are many other tweaks available to the user via a key-value interface. I have five key groups: 1) keys that should only be used at loading time or in a setup command (e.g. the choice of whether commands like \models and \vdash should be redefined to their package equivalents); 2) keys that affect the overall design of a turnstile symbol (e.g. the choice of which typeface to match); 3) keys that affect only some small design details (e.g. the vertical offset of the superscript box from the turnstile crossbar); 4) keys that should only be used in an optional argument to a turnstile command and are short aliases of key-value pairs from group 2; 5) keys that should only be used in an optional argument to a turnstile command and are short aliases of key-value pairs from group 3. In each turnstile command, the user should have the choice of either using the full key-value expression, or using the short aliases. A turnstile command that produces the equivalent of \gleichstark (U+29E6) then has three optional arguments: the first should accept keys from groups 2-5 (fixing the overall design of =||=), but the second and third should only accept keys from groups 3 and 5 (to tweak each of =| and |= independently, without making them badly mismatched, e.g. by having one mimic ArevMath and the other MnSymbol). I originally implemented this with the pgfkeys filtering commands, but I've since decided to rework the whole thing in L3 - hence my interest in achieving something similar in l3keys.