\ifundefined
\ifundefined{cs} t \else f \fi
expands the
t text if the control sequence \cs
is undefined or
has been \let
to \relax
, and the f text otherwise.
Since \ifundefined
is not a primitive conditional, it cannot be
used in places where TeX might skip tokens "at high speed", e.g.,
within another conditional---TeX can't match up the \if
's and
\fi
's.
This macro was taken directly from The TeXbook, page 308.