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 s4LMHtCm005318 for ; Thu, 22 May 2014 00:17:56 +0200 Received: from relay.uni-heidelberg.de ([129.206.100.212]) by mx-ha.gmx.net (mxgmx009) with ESMTPS (Nemesis) id 0MJXHX-1WlJx8460J-0036DP for ; Thu, 22 May 2014 00:17:50 +0200 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [129.206.100.94]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id s4LMEuRO016021 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 22 May 2014 00:14:56 +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 s4LM14pT027949; Thu, 22 May 2014 00:14:56 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 11050421 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Thu, 22 May 2014 00:14:56 +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 s4LMEtoc029543 for ; Thu, 22 May 2014 00:14:55 +0200 Received: from mail-yk0-f174.google.com (mail-yk0-f174.google.com [209.85.160.174]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id s4LMEjdY015948 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=FAIL) for ; Thu, 22 May 2014 00:14:48 +0200 Received: by mail-yk0-f174.google.com with SMTP id 9so2136664ykp.5 for ; Wed, 21 May 2014 15:14:44 -0700 (PDT) X-Received: by 10.236.82.104 with SMTP id n68mr31448031yhe.142.1400710484928; Wed, 21 May 2014 15:14:44 -0700 (PDT) Received: from Democritus ([168.30.48.40]) by mx.google.com with ESMTPSA id m50sm5578158yha.8.2014.05.21.15.14.44 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 21 May 2014 15:14:44 -0700 (PDT) X-Google-Original-Sender: "Jura Pintar" MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 15.0 Thread-Index: Ac91QgCx3xrqZTQkTXeDbqMn3cJfPw== Content-Language: en-us Message-ID: <00e701cf7542$114f8870$33ee9950$@post.harvard.edu> Date: Wed, 21 May 2014 18:14:41 -0400 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: pintar@POST.HARVARD.EDU Subject: Trouble with the .bool_set:N property To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE 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:co7DK9m/4jc=:9c/eCrIq3/zjuVWflapmcQv9Pg 0h5PfGasV28BxpH5fz0sBpq28LErVkiQP0ayyTvCCqgP2lEm/ZD/Lk6TzniBXn9RMLd1A7eoK 0Bm+UZw8QuncqKhmXRoRfdqAbGL1D0VcnORlfkvcMMHTvueUs4a+iuV1Y+kowzeIdag19EJC2 Mcp2KuWLkhdk2SNDLqXQP41GSnRqelKXyfrwGBEIgh0ZsowmWgnF1wWDnVlanG7OuumP9wk00 5JzEveUaIebY2hRvK36qTzdqMiqBhhb7IZFcAJOR3VL+S0tQOTpw6xu7DcWHip3A93YGPjiJm hHG/7n2ZsLblaKthEDs6hpV+q5Ar7wcN2TH+K77+4cNszax5YhUpHuGn8RvUhJaV8FkMk0puP K8LFcVYalhn4EaSXy9jXXcisNR/HTeJR8YjhTgViifgr4yllsgVRIkbww6Vmq7tvaBrThDlzD 2tbz0URuGS/LpRsiQ0Kj2OFM2G4r9xIhqgq6rkCdBUMsIJb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v X-UI-Loop:V01:7iTerWc2anY=:XgATeEUgGXpqjazTa89Tz9EQx6cudlwQ2PBm6R1hl/4= Status: R X-Status: X-Keywords: X-UID: 7437 Hello all (especially Joseph, who might have to deal with this), Based on the discussion at http://tex.stackexchange.com/questions/179180 there seems to be a problem with the definition of \__keys_bool_set:Nn. Namely, it is not obvious that the following code should fail \keys_define:nn { mymodule } { key-1 .choice: , key-1 / choice-a .bool_set:N = \l_mymodule_choice_a_bool, key-1 / choice-b .bool_set:N = \l_mymodule_choice_b_bool } \keys_set:nn { mymodule } { key-1 = choice-a } and yet it hangs because \__keys_bool_set:Nn actually creates a choice key with the choices 'true' and 'false' under the hood. I feel it would be more natural if the code above behaved in the same way as the following: \keys_define:nn { mymodule } { key-2 .bool_set:N = \l_mymodule_choice_a_bool } \keys_set:nn { mymodule } { key-2 } In other words, the code that now hangs should just be setting the boolean to 'true'. If \__keys_bool_set:Nn and \__keys_bool_set_inverse:Nn were redefined along the lines of the code below, we'd get that result. \cs_new_protected:Npn \__keys_bool_set:Nn #1#2 { \bool_if_exist:NF #1 { \bool_new:N #1 } \__keys_cmd_set:nn { \l_keys_path_tl } { \str_case_x:nnF { \l_keys_value_tl } { { true } { \use:c { bool_ #2 set_true:N } #1 } { false } { \use:c { bool_ #2 set_false:N } #1 } } { \cs_if_exist:cTF { \c__keys_code_root_tl \l_keys_path_tl / \l_keys_value_tl } { \use:c { bool_ #2 set_true:N } #1 } { \__msg_kernel_error:nnx { kernel } { boolean-values-only } { \l_keys_key_tl } } } } \__keys_default_set:n { true } } \cs_new_protected:Npn \__keys_bool_set_inverse:Nn #1#2 { \bool_if_exist:NF #1 { \bool_new:N #1 } \__keys_cmd_set:nn { \l_keys_path_tl } { \str_case_x:nnF { \l_keys_value_tl } { { true } { \use:c { bool_ #2 set_false:N } #1 } { false } { \use:c { bool_ #2 set_true:N } #1 } } { \cs_if_exist:cTF { \c__keys_code_root_tl \l_keys_path_tl / \l_keys_value_tl } { \use:c { bool_ #2 set_false:N } #1 } { \__msg_kernel_error:nnx { kernel } { boolean-values-only } { \l_keys_key_tl } } } } \__keys_default_set:n { true } } Finally, and a lower priority: it might also be useful to add the properties .bool_set_true:N and .bool_set_false:N as well. For example, they could work like this: \cs_new_protected:Npn \__keys_bool_set_true:Nn #1#2 { \bool_if_exist:NF #1 { \bool_new:N #1 } \__keys_cmd_set:nn { \l_keys_path_tl } { \use:c { bool_ #2 set_true:N } #1 } \__keys_value_requirement:n { forbidden } } \cs_generate_variant:Nn \__keys_bool_set_true:Nn { c } \cs_new_protected:Npn \__keys_bool_set_false:Nn #1#2 { \bool_if_exist:NF #1 { \bool_new:N #1 } \__keys_cmd_set:nn { \l_keys_path_tl } { \use:c { bool_ #2 set_false:N } #1 } \__keys_value_requirement:n { forbidden } } \cs_generate_variant:Nn \__keys_bool_set_false:Nn { c } \cs_new_protected:cpn { \c__keys_props_root_tl .bool_set_true:N } #1 { \__keys_bool_set_true:Nn #1 { } } \cs_new_protected:cpn { \c__keys_props_root_tl .bool_set_true:c } #1 { \__keys_bool_set_true:cn {#1} { } } \cs_new_protected:cpn { \c__keys_props_root_tl .bool_gset_true:N } #1 { \__keys_bool_set_true:Nn #1 { g } } \cs_new_protected:cpn { \c__keys_props_root_tl .bool_gset_true:c } #1 { \__keys_bool_set_true:cn {#1} { g } } \cs_new_protected:cpn { \c__keys_props_root_tl .bool_set_false:N } #1 { \__keys_bool_set_false:Nn #1 { } } \cs_new_protected:cpn { \c__keys_props_root_tl .bool_set_false:c } #1 { \__keys_bool_set_false:cn {#1} { } } \cs_new_protected:cpn { \c__keys_props_root_tl .bool_gset_false:N } #1 { \__keys_bool_set_false:Nn #1 { g } } \cs_new_protected:cpn { \c__keys_props_root_tl .bool_gset_false:c } #1 { \__keys_bool_set_false:cn {#1} { g } } All the best, Jura Pintar