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 p81E9lIA028329 for ; Thu, 1 Sep 2011 16:09:48 +0200 Received: (qmail 4842 invoked by alias); 1 Sep 2011 14:09:41 -0000 Delivered-To: GMX delivery to rainer.schoepf@gmx.net Received: (qmail invoked by alias); 01 Sep 2011 14:09:41 -0000 Received: from relay.uni-heidelberg.de (EHLO relay.uni-heidelberg.de) [129.206.100.212] by mx0.gmx.net (mx049) with SMTP; 01 Sep 2011 16:09:41 +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 p81E7NRa030569 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 1 Sep 2011 16:07:23 +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 p81DaXul021245; Thu, 1 Sep 2011 16:07:22 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 1633985 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Thu, 1 Sep 2011 16:07:22 +0200 Received: from relay.uni-heidelberg.de (relay.uni-heidelberg.de [129.206.100.212]) by listserv.uni-heidelberg.de (8.13.1/8.13.1) with ESMTP id p81E7LJ7032258 for ; Thu, 1 Sep 2011 16:07:21 +0200 Received: from mail-ew0-f49.google.com (mail-ew0-f49.google.com [209.85.215.49]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id p81E78PQ030428 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=FAIL) for ; Thu, 1 Sep 2011 16:07:12 +0200 Received: by ewy3 with SMTP id 3so1328628ewy.22 for ; Thu, 01 Sep 2011 07:07:08 -0700 (PDT) MIME-Version: 1.0 Received: by 10.213.28.142 with SMTP id m14mr23286ebc.124.1314886028133; Thu, 01 Sep 2011 07:07:08 -0700 (PDT) Received: by 10.213.105.201 with HTTP; Thu, 1 Sep 2011 07:07:07 -0700 (PDT) References: <1rb2vdciob67d$.dlg@nililand.de> <4E5F75C0.8030105@morningstar2.co.uk> Content-Type: text/plain; charset=ISO-8859-1 Message-ID: Date: Thu, 1 Sep 2011 16:07:07 +0200 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Philipp Stephani Subject: Re: Internal equivalent of \providecommand? 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 (BackTrace mail analyze); Detail=5D7Q89H36p4L00VTXC6D4q0N+AH0PUCnGL2vqOgpaBYL16oitsMrgDt/NQNpSCZFFjDOy 97xb7Zpf+wZnd5ZXNcvLDXR3Wg3wRjdQbwEMh8=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: 6855 2011/9/1 Ulrike Fischer : > Am Thu, 1 Sep 2011 13:08:32 +0100 schrieb Joseph Wright: > >> On 01/09/2011 11:57, Ulrike Fischer wrote: >>> Is there an expl3 equivalent for a \providecommand? >>> >>> I could do >>> >>> \cs_if_free:NT \mycommand {\cs_set:Npn \mycommand {...}} >>> >>> but I don't find it very elegant to have to type \mycommand twice. > >> At the code level, the answer is 'no'. Within a module, we'd expect all >> functions to be well-defined: if they 'might' be needed, they should >> exist. (See for example the fact that a lot of internal aux functions >> are created simply to mark the name as taken.) > >> Now, there is the reality that LaTeX2e stuff is often not so >> well-designed and does sometime rely on 'might exist' functions. There, >> I'm afraid the construct you've pointed to is the way to go. > > > Well my command (it is more a variable so \tl_set would perhaps be > more correct) must exist and that's why I'm using \providecommand: > To make sure *that* is exists. I'm not relying on a "might exist" > command but try to ensure that it is a "does exist" command. > > The problem is that it must exist in various encoding definitions > files for fontenc, in the sty (chessfss) and that its "value" can be > set/changed by the user -- which means that I have no control over > the location where the default value should be set. I have to set it > in various places in such a way that it doesn't overwrite user > settings. Wouldn't it be more appropriate to use a key-value option with default value then?