LATEX-L Archives

Mailing list for the LaTeX3 project


Options: Use Classic View

Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Sender: Mailing list for the LaTeX3 project <[log in to unmask]>
Date: Thu, 1 Sep 2011 17:51:43 +0100
Reply-To: Mailing list for the LaTeX3 project <[log in to unmask]>
Message-ID: <[log in to unmask]>
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
In-Reply-To: <[log in to unmask]>
Content-Type: text/plain; charset=ISO-8859-1
From: Joseph Wright <[log in to unmask]>
Parts/Attachments: text/plain (26 lines)
On 01/09/2011 17:10, Ulrike Fischer wrote:
> 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.  

That sounds more like what I'd encourage: set up the variable first,
then allow user changes later. I'd also suggest providing an interface
to the variable, rather than the variable itself. Key-value methods have
already been mentioned, but for a one-off setting something like

  \NewDocumentCommand \setthing { m } { \tl_set:Nn \l_my_thing_tl {#1} }

would be appropriate. (This is all part of the idea of separating
interface from code.)
Joseph Wright