[luatex] macros to invoke lua in LaTeX
oberdiek at uni-freiburg.de
Thu Mar 5 23:06:21 CET 2009
On Thu, Mar 05, 2009 at 06:07:10PM +0100, Taco Hoekwater wrote:
> Ulrike Fischer wrote:
> > luatex the other side is _new_. Why doesn't it use names where
> > there is less danger that someone will try to overwrite it?
> Well, that is why the primitive \primitive exists (and the alias
> \pdfprimitive): so that you always have access to all primitives
> in the engine (well, unless a smartass package would redefine
> \primitive and \pdfprimitive, of course).
There are quite some applications in LaTeX, that are based on
the possibility to redefine a primitive command, e.g.
\shipout is redefined in various packages (atbegshi, everyshi,
pdftex.def for background color, ...).
Another application is debugging, e.g. \special is a candidate,
that can be redefined to print its contents to the .log file
All these wouldn't be possible, if \(pdf)primitive was used.
> > It would be a
> > pity if you would have to use \latexluanewthing with latex3 and
> > \ctxluanewthing with context and \memluanewthing in latex2e when
> > using the memoir class and \komaluanewthing when using a KOMA-class.
> That virtual "you" will not be using all of these packages, and
> even if that "you" would do so, I still don't see a *practical*
> case for each of those packages having an *actual* clash with
> *any* primitive. The whole name conflict thing has been virtual
> so far, with the only person actually affected: Hans himself.
> Let's be clear on this: we will not start prefixing every new
> primitive with some random string, and I believe we have explained
> quite thoroughly why we will not do so. We have heard all the
> arguments in favour of prefixes before, and we are still not
As example, you got lucky with \formatname: LaTeX uses \fmtname,
quite close already, I would say.
The point is that there is software written at a time with
a known set of command names from the engines.
Now the engines evolve further and introduces new command names.
This can lead to name clashes, because the engine developer
cannot know all software that is based on the engine to avoid them.
Prefixing helps to reduce the probability of such name clashes.
With reserved prefixes they can even be avoided.
Heiko <oberdiek at uni-freiburg.de>
More information about the luatex