Consider the following:
\let\1=X
\edef\2{\1}
\show\1 \show\2
The result is
> \1=the letter X.
> \2=macro:
->\1.
Is it possible to ‘expand’ the meaning of \1 so that \2 contains just X? The only solution I can think of is to use \meaning on \1 and cut out the prefix, but that doesn't seem very elegant.
(Context: I'm writing a scanning function that looks ahead at the next token and then either adds it to a scratch variable or terminates the scanning. Can't add it to the scratch variable without expanding it first, though! But it's not the context that I care about, since I can do the loop in another way; I'm interested in this particular question.)
tokenlibrary. – Philipp Dec 24 '10 at 12:21