I was implementing an ad hoc list data structure inside LaTeX, where
\aaa expands value for aaa, \bbb exapnds value for bbb and to show that \bbb is next to \aaa on the list, \NEXTaaa expand to bbb, and I do not define \NEXTbbb. These definitions are done with \@namedef.
Using ifthen macros to work the code, I found a (supposedly) bug. I cannot compare \relax to macros \relax-like, like the one got after expansion of \csname UndefinedCmd\endcsname.
The question is: after \let\abc\relax, how to get a successfully compare \abc with \relax using ifthen macros? I am actually getting \equal{\abc}{\relax} -> false!!! Is this a bug on ifthen?
MWE:
\documentclass{article}
\usepackage{ifthen}
\begin{document}
\let\abc\relax
\ifthenelse{\equal{\abc}{\relax}}
{Good!}
{Bad :-(}
%% I read Bad :-( on PDF file.
\end{document}

\equaldoesn't actually compare the meaning of\abcand\relax. It does\def\a{\abc},\def\b{\relax}, then compares\aand\b, which contain different things, so are different. – Phelype Oleinik Mar 25 '22 at 18:49ifthenis to not useifthen:) – Phelype Oleinik Mar 25 '22 at 18:57