I thought the way to undo a \def was to define it to \relax, but that does not appear to work. Also, am not sure why this produces no output if I try to use \def instead of \let in my attempt to do an undef.
\documentclass{article}
\begin{document}
\def\CaseA{}%
\ifdefined\CaseA%
\def\ProcessCaseA{}%
% Do stuff that uses \ProcessCaseA
%\def\ProcessCaseA\relax% no output if use this, and comment next line
\let\ProcessCaseA\relax% no output if comment this, and use above line
\fi
% Now do stuff that requires \ProcessCaseA NOT be defined
\ifdefined\ProcessCaseA
ERROR: \textbackslash ProcessCaseA is still defined
\else
SUCCESS: \textbackslash ProcessCaseA is not defined
\fi
\end{document}
\@undefinedis defined. (But I think that's assumed at some places in the kernel as well, so \def@undefined{} would likely break a lot of stuff anyway, so the user will notice.) – Ulrich Schwarz Jun 14 '11 at 07:09\@undefinedis used more than 800 times in my texmf tree, so it is a good assumption. – yo' Mar 06 '12 at 10:23