What you need to understand here is that \csname ... \endcsname "expands" things until it has a string of character tokens (letters, numbers, spaces, punctuation, etc.). However, there are some things which don't expand but also aren't characters. A classic one is \relax, which does nothing but is "unexpandable".
There is a crucial difference between getting TeX to print something (where \relax is executed, does nothing and disappears) and expand something. For example, if I write:
I get no spaces and the definition of \relax "disappears". However, if I do:
The expanded definition (\edef) does not make \relax disappear: the definition of \temp still contains \relax. If I then tried:
Code: Select all
\expandafter\def\newtemp\csname \temp\encsname
I'd get a complaint from TeX.
The non-expandability of some macros is a pain. However, a simple test is do \edef the content then \show it (as I've done above). If there is anything left other than characters, \csname will not work.