LATEX-L Archives

Mailing list for the LaTeX3 project


Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

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

Print Reply
Joseph Wright <[log in to unmask]>
Reply To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Thu, 1 Sep 2011 17:51:43 +0100
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