[tex-k] A218, A219: confusion of TeX's mouth and stomach
胡亚捷 (Hu Yajie)
2500418497 at qq.com
Tue Mar 2 15:46:19 CET 2021
Page A219, line -9 says
`\length{argument}' expands to `8'.
but if you try the macro
\def\length#1{{\count0=0 \getlength#1\end \number\count0}}
\def\getlength#1{\ifx#1\end \let\next=\relax
\else\advance\count0 by1 \let\next=\getlength\fi \next}
by saying
\message{\length{argument}}
or \edef\\{\length{argument}} \show\\
or \count255=\length{argument} \showthe\count255
you get error messages. The \length macro doesn't expand to `8'; it expands
to a series of tokens that yield the result `8'. Some of the tokens are
handled in TeX's mouth and some in TeX's stomach, so it's not accurate to
say that `\length{argument}' expands to `8'.
Similarly, page A218, line 21 says
TeX did all of the calculation by expanding the \primes macro
but the \primes macro contains assignments like \p=5 and \advance\n by-2
which are not carried out during macro expansion.
I'm not sure if other parts of The TeXbook contains similar errors.
More information about the tex-k
mailing list.