[tex-k] TeXbook: wrong test when * has catcode 10

Igor Liferenko igor.liferenko at gmail.com
Wed Oct 25 12:58:31 CEST 2023


Hi, all

On p.377 of TeXbook it is said that when * has catcode 10,
the test

    \if\fspace*

is false.

But in this case * is simply ignored during tokenization.
It can be confirmed by adding another \fspace after *:

    \if\fspace*\fspace\message{TRUE}\else\message{FALSE}\fi

We get TRUE. If * were not ignored, we would get FALSE.

The test can be corrected by simply putting the * in braces,
i.e., \if\fspace* should be changed into \if\fspace{*}

    \uccode` =`* \uppercase{\uppercase{\def\fspace{ }\let\ftoken= } }
    \catcode`*=10
    \if\fspace{*}\message{TRUE}\else\message{FALSE}\fi
    %\if\fspace*\fspace\message{TRUE}\else\message{FALSE}\fi
    \bye

Regards,
Igor


More information about the tex-k mailing list.