I'm learning TeX from the texbook. I tried to write a loop that is similar to part of the solution to exercise 11.5 (on page 215):
Code: Select all
\def\dolist{\afterassignment\dodolist\let\next= }
\def\dodolist{\ifx\next0 \let\again\relax \else
[\next]\let\again\dolist \fi \again}
\dolist 1 2 3 0
However, if we remove the space right after "\next=":
Code: Select all
\def\dolist{\afterassignment\dodolist\let\next=}
\def\dodolist{\ifx\next0 \let\again\relax \else
[\next]\let\again\dolist \fi \again}
\dolist 1 2 3 0
Can anyone explain the difference? I guess I'm confused with the tokenizing/expanding processes.
Thanks in advance!
Alan