[texhax] Force double expansion ?

Philip Taylor P.Taylor at Rhul.Ac.Uk
Wed Jul 16 22:59:11 CEST 2014



Uwe Lueck wrote:

> Are you really asking for the simple
>
>    \expandafter\expandafter\expandafter \futurelet
>        \expandafter\expandafter\expandafter \nexttok
>            \expandafter\expandafter\expandafter \analysenexttok

It would seem not, Uwe, since when used in the context given, it yields 
an error :

> % !TeX Program=XeTeX
>
> \def \examinenexttok {\message {Nexttok: \meaning \nexttok}}
> \def \whatever {\csname namespace: }
> \let \endwhatever = \csname
> \expandafter \def \csname namespace: test\endcsname {"namespace: test"}
> \tracingall
>   \expandafter\expandafter\expandafter \futurelet
>       \expandafter\expandafter\expandafter \nexttok
>           \expandafter\expandafter\expandafter \analysenexttok
>           	\whatever test\endwhatever
>  \end

which yields :

This is XeTeX, Version 3.1415926-2.5-0.9999.3 (TeX Live 2013/W32TeX)
  restricted \write18 enabled.
entering extended mode
(./untitled-12.tex
{vertical mode: \tracingstats}
  ...
{\expandafter}
{\expandafter}
{\expandafter}
{\expandafter}
{\expandafter}
{\expandafter}

\whatever ->\csname namespace:
{\expandafter}
{\expandafter}
{\expandafter}
{\csname}
{\csname}
! Missing \endcsname inserted.
<to be read again>
                    \end
l.12  \end

?

Philip Taylor



More information about the texhax mailing list