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 p81GGDDm028046 for ; Thu, 1 Sep 2011 18:16:14 +0200 Received: (qmail 4023 invoked by alias); 1 Sep 2011 16:16:08 -0000 Delivered-To: GMX delivery to rainer.schoepf@gmx.net Received: (qmail invoked by alias); 01 Sep 2011 16:16:07 -0000 Received: from relay2.uni-heidelberg.de (EHLO relay2.uni-heidelberg.de) [129.206.210.211] by mx0.gmx.net (mx050) with SMTP; 01 Sep 2011 18:16:07 +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 p81GAeLw026409 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 1 Sep 2011 18:10:40 +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 p81Ev9Bj021245; Thu, 1 Sep 2011 18:10:40 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 1638168 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Thu, 1 Sep 2011 18:10:40 +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 p81GAdoo016413 for ; Thu, 1 Sep 2011 18:10:39 +0200 Received: from ix.urz.uni-heidelberg.de (cyrus-portal.urz.uni-heidelberg.de [129.206.100.176]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id p81GAdbP026399 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 1 Sep 2011 18:10:39 +0200 Received: from relay.uni-heidelberg.de (relay.uni-heidelberg.de [129.206.100.212]) by ix.urz.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id p81GAdvK016710 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 1 Sep 2011 18:10:39 +0200 Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id p81GAQnh022180 for ; Thu, 1 Sep 2011 18:10:30 +0200 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Qz9qP-0008Bu-It for LATEX-L@URZ.UNI-HEIDELBERG.DE; Thu, 01 Sep 2011 18:10:21 +0200 Received: from pd954bab7.dip.t-dialin.net ([217.84.186.183]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 01 Sep 2011 18:10:21 +0200 Received: from news3 by pd954bab7.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 01 Sep 2011 18:10:21 +0200 X-Injected-Via-Gmane: http://gmane.org/ Lines: 48 References: <1rb2vdciob67d$.dlg@nililand.de> <4E5F75C0.8030105@morningstar2.co.uk> <4E5FA851.3040504@morningstar2.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: pd954bab7.dip.t-dialin.net User-Agent: 40tude_Dialog/2.0.15.41de X-Spam-Flag: No X-Envelope-From: X-Spam-Status: No, hits=-4.40 required=5 tests=AWL,BAYES_00,L_P0F_Linux,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, SPF_PASS Message-ID: Date: Thu, 1 Sep 2011 18:10:03 +0200 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Ulrike Fischer Subject: Re: Internal equivalent of \providecommand? To: LATEX-L@listserv.uni-heidelberg.de Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: X-GMX-Antispam: 0 (eXpurgate); Detail=5D7Q89H36p6sJLDpZh614LdjtwLz6vwIeHOUoT3aAkmAkWe0Z43ZfC59x0Zo8mxVvYIyB G55P0D0sXVERnxtHYhtbGfSbR+azSPWCzjM9Q1R3v6nLkcZuv0QRQqQp++Z4Ftwgh6HzXPSA1ciD oXpypPfEATH86hFi7FZu41P+ak/xlRXNzP3SAZHfjS0nDI0YgfQcp1h3QE=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: 6858 Am Thu, 1 Sep 2011 16:44:17 +0100 schrieb Joseph Wright: > On 01/09/2011 13:53, Ulrike Fischer wrote: >> 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. > > That's broadly what I mean by 'LaTeX2e issues': having a value which is > used directly at a user level, and in various files, is not good. > > You don't say if the value might alter again after you've > \providecommand'd it. If not, then I'd be tempted to go with something like > > \tl_new:N \l__tl > \cs_if_exist:NTF \ > { \tl_set_eq:NN \l__tl \ } > { \tl_set:Nn \l__tl { } } > > On the other hand, if this variable in question has to be user-setable > at any point, then you can't use an internal value and have to stick to > a manual '\providecommand' approach. > > (I'm assuming that the variable in question is one that is already > required by LaTeX2e constructs, and so 'simply do things differently' is > not an option.) The variable in question is my own command and I can do with it what I want. That is not the problem. But as I now started to rewrite chessfss with expl3 I'm trying to use clean code, to exploit its features and to avoid unnessary hacks and compromisses. And after thinking more about it: I think the cleanest solution is to export the commands in question in a .sty and to use \RequirePackage to include them in the various files. Then they are set exactly once and are only in one place. -- Ulrike Fischer