1

On p. 40 of the TEXbook, it says that \csname TeX\endcsname is essentially the same as \TeX. But, if that is so, why isn't \foo defined below?

% tex
This is TeX, Version 3.14159265 (TeX Live 2019) (preloaded format=tex)
**\def\csname foo\endcsname{bar}

*\message{\csname foo\endcsname}
bar
*\message{\foo}
! Undefined control sequence.
<*> \message{\foo
                }
?
Toothrot
  • 3,346

1 Answers1

5
\def\csname foo\endcsname{bar}

redefines \csname, you wanted

\expandafter\def\csname foo\endcsname{bar}
David Carlisle
  • 757,742