I know \expandafter can skip the token immediately after it, therefore I try to use it with some combinations of } , \toks and definitions with \def and \let.
The main question the puzzles me is why consecutive uses of \toks like \the\toks0\the\toks0 will extend \expandafter's effect? In theory should it not be last only to the first \the\toks0?
I tried with this:
\toks0{()}
\def\asd{()}
%
1{\def\asd{\TeX}}\asd \par
2{\let\asd\TeX}\asd\par
3{\toks0{\TeX}}\the\toks0\par
4{\toks0{\TeX}}\the\toks0\relax\par
5{\toks0{\TeX}}\the\toks0\the\toks0\relax\par
6{\toks0{\TeX}}\the\toks0\the\toks0\the\toks0\relax\par
7{\toks0{\TeX}}\the\toks0\relax\the\toks0\par
8{\def\asd{\TeX}\expandafter}\asd\par
9{\def\asd{\TeX}\expandafter}\asd\asd\par
10{\let\asd\TeX\expandafter}\asd\par
11{\let\asd\TeX\expandafter}\asd\asd\par
12{\toks0{\TeX}\expandafter}\the\toks0\par
13{\toks0{\TeX}\expandafter}\the\toks0\relax\par
14{\toks0{\TeX}\expandafter}\the\toks0\the\toks0\par
15{\toks0{\TeX}\expandafter}\the\toks0\the\toks0\the\toks0\par
16{\toks0{\TeX}\expandafter}\the\toks0\relax\the\toks0\par
17{\toks0{\TeX}\expandafter}\the\toks0 \the\toks0\par
%
\bye
And the output is like this:
