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 q4QJorZh005995 for ; Sat, 26 May 2012 21:50:54 +0200 Received: (qmail 958 invoked by alias); 26 May 2012 19:50:48 -0000 Delivered-To: GMX delivery to rainer.schoepf@gmx.net Received: (qmail invoked by alias); 26 May 2012 19:50:47 -0000 Received: from relay.uni-heidelberg.de (EHLO relay.uni-heidelberg.de) [129.206.100.212] by mx0.gmx.net (mx048) with SMTP; 26 May 2012 21:50:47 +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 q4QJm75n003808 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 26 May 2012 21:48:07 +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 q4PM1ZEP006546; Sat, 26 May 2012 21:47:49 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 1991208 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Sat, 26 May 2012 21:47:49 +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 q4QJlnBo026565 for ; Sat, 26 May 2012 21:47:49 +0200 Received: from smtp.demon.co.uk (mdfmta010.mxout.tch.inty.net [91.221.169.51]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id q4QJkotQ022283 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 26 May 2012 21:47:43 +0200 Received: from mdfmta010.tch.inty.net (unknown [127.0.0.1]) by mdfmta010.tch.inty.net (Postfix) with ESMTP id A8FBB4000B5; Sat, 26 May 2012 20:46:47 +0100 (BST) Received: from mdfmta010.tch.inty.net (unknown [127.0.0.1]) by mdfmta010.tch.inty.net (Postfix) with ESMTP id 8A356400097; Sat, 26 May 2012 20:46:47 +0100 (BST) Received: from palladium.local (unknown [80.176.134.7]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mdfmta010.tch.inty.net (Postfix) with ESMTP; Sat, 26 May 2012 20:46:47 +0100 (BST) User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 References: X-Enigmail-Version: 1.4.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-MDF-HostID: 19 Message-ID: <4FC13326.1060904@morningstar2.co.uk> Date: Sat, 26 May 2012 20:46:46 +0100 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Joseph Wright Subject: Re: Should l3keys provide a key .initial:n? To: LATEX-L@listserv.uni-heidelberg.de In-Reply-To: Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: X-GMX-Antispam: 0 (Sender is in whitelist: joseph.wright@MORNINGSTAR2.CO.UK); Detail=5D7Q89H36p4L00VTXC6D4q0N+AH0PUCnBi0P5cROEGjO+pG7NAH/K+tf9SrVFtpLrKONl 2T9EL4W4U4jgzLbnCcGpk1z/zwmKT/K1fv3lD0=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: 7056 On 26/05/2012 16:12, Marco Daniel wrote: > Hello, > > Today I noticed that there is no key .initial:n. This question popped up > during writing a small package. Whatever at the moment you have the > following possibilities to set a key-value-syntax with an initial value: > ======================================================================= > %First approach: > > \keys_define:nn { module } > { > myoption .int_set:N = \l_modul_myoption_int > } > \keys_set:nn { module } > { > myoption = 2 > } > \ProcessKeysOptions { module } > > ======================================================================= > Second approach > > \keys_define:nn { module } > { > myoption .int_set:N = \l_modul_myoption_int , > myoption .default:n = 2 > } > \keys_set:nn { module } { myoption } > \ProcessKeysOptions { module } > > ======================================================================= Note that this are not equivalent when you consider the behaviour later on. In the second case, giving "myoption" is the same as "myoption = 2", but in the first case the two are distinct. > I suggest to define a new key .initial:n so that we have a third approach: > > Second approach > > \keys_define:nn { module } > { > myoption .int_set:N = \l_modul_myoption_int , > myoption .initial:n = 2 > } > \ProcessKeysOptions { module } > > ======================================================================= At one point we did have this. Checking back through the archive, I removed it as it did not seem to add anything to the two-stage process. However, that was not a 'strong' objection: I was simply trying to keep the number of properties down as far as possible. If this looks like a useful addition I've no problem adding it back in: anyone else have a view? -- Joseph Wright