[texhax] defin'd?

Joseph Wright joseph.wright at morningstar2.co.uk
Wed Dec 23 14:30:15 CET 2015


On 23/12/2015 13:17, Uwe Lueck wrote:
> Discussing with Reinhard Kotucha, Philip Taylor argued
>  
>> P.S. I think the following demonstrates why \@undefined is
>> markedly inferior to \ifcsname :
> [etc.]
> 
> probably meaning inferiority of \LaTeX's \@ifundefined to the
> \varepsilon-\TeX primitive \ifcsname, in that \@ifundefined
> uses \csname and thus may assign a meaning to a named token
> that before didn't have a meaning, or simply may increase the
> hash table without increasing functionality. Both the two of
> them (the German comedian equivalent may be "die zwei beiden")
> also referred to a similar discussion on the list many years
> ago (Phil provided the URL).
> 
> I would like to remind readers of a third approach that uses
> \csname and though does not increase the hash table
> (permanently -- made in Germany): Bernd Raichle's german.sty
> has (had)
> 
>     \begingroup\expandafter\expandafter\expandafter\endgroup
>     \expandafter\ifx\csname ProvidesPackage\endcsname\relax
> 
> So definedness of \ProvidesPackage as \ifx-equivalent to 
> \relax is restricted to a local group, outside true 
> undefinedness is not affected.
> 
> There could be a variant \@IfUndefined of \@ifundefined with 
> an only local side effect as follows:
> 
>     \def\@IfUndefined#1{%
>         \begingroup\expandafter\expandafter\expandafter\endgroup
>         \expandafter\ifx\csname #1\endcsname\relax
>               \expandafter\@firstoftwo
>         \else \expandafter\@secondoftwo \fi}

Noting that this is not expandable, in contrast to LaTeX's \@ifundefined
and \ifcsname. (The latter is clearly the best approach when allowed.)

> P.S.: I have ignored \varepsilon-\TeX\ until very recently ...
> sympathizing with minimalistic implementations of \TeX. On
> the other hand, I don't agree much when I read that the NTS
> project "failed" -- \varepsilon-\TeX\ has been a useful result.

Given that other than "tex", all widely-used binaries in use nowadays
feature the extensions, I think e-TeX is clearly a success. Whether it
achieved everything desirable is a different matter, of course.

Joseph



More information about the texhax mailing list