Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) by h1439878.stratoserver.net (8.14.2/8.14.2/Debian-2build1) with ESMTP id r5KMgUj5018351 for ; Fri, 21 Jun 2013 00:42:31 +0200 Received: from relay2.uni-heidelberg.de ([129.206.210.211]) by mx-ha.gmx.net (mxgmx103) with ESMTP (Nemesis) id 0LyT18-1UCjR83CvG-015pTJ for ; Fri, 21 Jun 2013 00:42:25 +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 r5KMdB1X032268 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 21 Jun 2013 00:39:11 +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 r5KM15we030824; Fri, 21 Jun 2013 00:39:10 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 9963227 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Fri, 21 Jun 2013 00:39:10 +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 r5KMdAEg000417 for ; Fri, 21 Jun 2013 00:39:10 +0200 Received: from mail-we0-f178.google.com (mail-we0-f178.google.com [74.125.82.178]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id r5KMd1wi013341 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=FAIL) for ; Fri, 21 Jun 2013 00:39:04 +0200 Received: by mail-we0-f178.google.com with SMTP id u53so5780419wes.23 for ; Thu, 20 Jun 2013 15:39:01 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.180.73.81 with SMTP id j17mr904604wiv.51.1371767941454; Thu, 20 Jun 2013 15:39:01 -0700 (PDT) Received: by 10.194.6.105 with HTTP; Thu, 20 Jun 2013 15:39:01 -0700 (PDT) Content-Type: text/plain; charset=UTF-8 X-MIME-Autoconverted: from quoted-printable to 8bit by listserv.uni-heidelberg.de id r5KMdAEg000418 Message-ID: Date: Thu, 20 Jun 2013 18:39:01 -0400 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: "Joel C. Salomon" Subject: Initialize l3keys definition from clist To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by relay2.uni-heidelberg.de id r5KMdB1X032268 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:C99mFo1E3A8=:TufFEd7HZ+mfYowLyzIvr4 r9gngrOXOFXkUFgLkQgewDP2i043uwGTKeJl3ABxm5ANqEcF3x/gaLycqzuSK+Xagw4Ycep li+McG3lSB5pW0DWaUwrCIAkpU2evXIN6fpmxaHmd+VJ+66/uPPwsGpZuRfx0iNT3HDKnzM TKPWXLkIWKMSrLw0LBs/kZesLrz0Xp3F0ptg6OK77PtojxHAy+7+UDw0nrU8BdVyfSA8Zho FFli3ggWteHLhCrQVLxUc7YcXkuSOGmwQk+Xm3rHNpEpRTHeBULKWf/GmJpiav5fFFbXER7 fvqS8i5xvRkOAvdFwtqC0LGgu6U3UE1BmdMVHMT11uSV0vuP+iwLKzhOt4CoaJEzjetyD+X S4TOnhPbaSrF4Dz7439Tlb5ED49826Guaq1UjiYxO5vH+KXeZLmj/5b6VybYx0jaTyTS9Js 2h1d21/OD7aMCbM8wTjP3RVBI5DeM3K3lHjfJQOdGa3DaiM7Ir3Mk4oYMIL3PBP3CREAKb/ kxH73l2YMgip9vGoHEN7dXgrkV6yBn+gmnvIXklwc3J7nAG7jIyyh6bEVi21eg0vQOXnaWK yEKC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Sz+G8TEm8=:Iu8QfS/ZVzH0wjTi7+MBG/fVUSv3dR/ojt4XFv93GoY= Status: R X-Status: X-Keywords: X-UID: 7205 On TeX.SE (http://tex.stackexchange.com/q/120258/2966), Prof. Enrico =E2=80=9Cegreg=E2=80=9D Gregorio helped me set up the below code, which s= ets up an l3keys definition from a clist. Note that the property `.generate_choice:V` has to be created; is it perhaps a useful addition to l3keys? Note also the way I've set the default value to the first element of the clist. I would assume that the "idiomatic" way would be font .initial:o =3D { \clist_item:Nn \c_jcsfonts_clist {1} }, or something like that, but of course, the property `.initial:o` doesn't exist. And unlike the rest of Expl3, there is no clean way to generate variants of l3keys properties; egreg's code needed to call on `\__`-private functions. Might this, too, be a useful addition to the package? Code follows. =E2=80=94Joel Salomon % Different choices, depending on the engine \bool_if:nTF { \xetex_if_engine_p: || \luatex_if_engine_p: } { \clist_const:Nn \c_jcsfonts_clist { fontin, constantia, lmodern } } { \clist_const:Nn \c_jcsfonts_clist { kpfonts, lmodern } } % Default to first in the list -- possibly not idiomatic \clist_get:NN \c_jcsfonts_clist \c_jcsfonts_default_tl % The property .generate_choice:V doesn't exist, so we create it \cs_generate_variant:Nn \__keys_choices_generate:n { V } \cs_new_protected:cpn { \c__keys_props_root_tl .generate_choices:V } #1 { \__keys_choices_generate:V {#1} } % Define keys \keys_define:nn { jcsfonts } { font .choice_code:n =3D \tl_gset:NV \g_jcsfonts_tl \l_keys_choice_tl, font .generate_choices:V =3D \c_jcsfonts_clist, font .initial:V =3D \c_jcsfonts_default_tl, font .value_required:, } % Define synonyms \clist_map_inline:Nn \c_jcsfonts_clist { \keys_define:nn { jcsres } { #1 .meta:n =3D { format =3D #1 }, #1 .value_forbidden: } } % Test for key \prg_new_conditional:Npnn \jcsfonts_if:n #1 { p, T, F, TF } { \str_if_eq:nVTF { #1 } \g_jcsfonts_tl { \prg_return_true: } { \prg_return_false: } }