[net.text] One-level token expansion in TeX.

jenny@ucbvax.BERKELEY.EDU (Kathryn Hargreaves) (01/06/86)

Although Knuth has an exercise on this topic, the solution uses
\expandafter. Although that works fine when the token to be expanded doesn't
have arguments, I would like to expand a control sequence ``one
level''---and not read any more tokens, even if that expansion is a macro
with arguments.

More precisely,
\def\macarg#1{This is a macro with argument #1.}
\futurelet\next\cont
\def\cont{
   if \next is a control sequence...

I get stuck at the above. I want to know if \next is a control sequence, but
I don't want to read more from the input if it happens to be a control
sequence with arguments. (Such as macarg.) If I knew it didn't have
arguments, I could do it using \ifcat and \expandafter---but it might.

Please mail me any ideas. Thanks.

Karl.			ucbvax!jenny 	jenny@ucbvax.berkeley.edu