[texhax] defin'd?

Uwe Lueck uwe.lueck at web.de
Thu Dec 24 17:34:08 CET 2015


A few hours ago, Reinhard Kotucha wrote:
>> >     \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.)
>
> ... and the macro above doesn't prevent anything from going into the
> hash table.

Should anybody have believed that the \csname in the definition of 
\@IfUndefined worked differently from how it works in \@ifundefined?
Of course it creates a hash table entry in the case of non-definedness.
Besides resetting the meaning to "undefined" (I believe Bernd Raichle 
wrote that this was the motivation, and this has been Phil's point, 
which I addressed), however, it would be nice if the \endgroup /removed/ 
the hash table entry. Can the quotes in Phil's 

    http://tug.org/pipermail/texhax/2015-December/022048.html

about removing hash table entries refer to something else than commands 
closing groups? (Were there \undef or so, resembling unalias and 
export -n?) Or was the intended feature finally given up, so that 
today hash table entries are permanent? -- Ah, Reinhard's preceding

   http://tug.org/pipermail/texhax/2015-December/022047.html

> quite unfortunate.  It adds something to the hash table which can
> never be removed and thus stays there forever.
> 
> Phil, we discussed this issue a few years ago and you forwarded a mail
> from someone who explained *why* TeX cannot remove unused csnames from
> the hash table.

However, this is not clear to me. In the first paragraph, there may 
be something special in the situation that /these/ hash table entries 
cannot be removed while others can. In the second paragraph, "unused" 
may as well refer to the myriads of funny macros that people like to 
to define/load while they are "not used" in some single document. (Or 
even: while almost nobody ever uses them. -- No wonder TeX does not 
remove them from the hash table, but some /definition macros/ could 
prevent defining things that were not used in previous runs, similar 
to the feature of printing only those bibliography entries that actually 
are cited.)

Happy TeX installations on the new computers waiting for you

 -- Uwe.


More information about the texhax mailing list