LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

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
Subject:
From:
Heiko Oberdiek <[log in to unmask]>
Reply To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Date:
Mon, 19 Sep 2011 12:45:57 +0200
Content-Type:
text/plain
Parts/Attachments:
text/plain (38 lines)
On Mon, Sep 19, 2011 at 10:42:22AM +0200, Marcin Borkowski wrote:

> Dnia 2011-09-11, o godz. 20:31:01
> Joseph Wright <[log in to unmask]> napisa??(a):
> 
> > Hello all,
> > 
> > Currently, provision of scratch variables (such as \l_tmpa_tl) is
> > somewhat inconsistent in expl3. However, it is also not entirely clear
> > if these 'general scratch' variables are really idea in any case. Do
> > people see a general need for these variables, or will most users
> > expect to define their own scratch space in all cases?
> > 
> > (The kernel does not use any of these scratch variables, so they are
> > only intended for third-party use in any case.)
> 
> I do not (yet) use LaTeX3, but I am an author of one LaTeX2e class (not
> distributed yet) and I have to say that I find such scratch variables
> quite useful.  Defining "private" ones in packages is what seems to me
> a waste of resources.

I agree. But the risks should not be forgotten.
Because any can use them, the author of one use case
has to be in full control of the code inbetween.
For example, using \count@ as scratch count register:

\count@=123
\modulo{\count@}{7}
\message{\number\count@}

And now \modulo also uses \count@ as scratch register ...

Sneaky bugs can happen if a scratch variable is used
and changed by several functions at the same time.

Yours sincerely
  Heiko Oberdiek

ATOM RSS1 RSS2