[tex-k] Bug-report for the TeXbook: Not all non-primitive control-sequences are defined, ultimately, in terms of the primitive ones.
ud.usenetcorrespondence at web.de
ud.usenetcorrespondence at web.de
Sun Dec 11 15:27:23 CET 2022
Laurence.Finston at gmx.net wrote.
> I am quite certain that the use of \def, \edef, \xdef or \let was not meant,
> but rather that the expansion of the macros was meant. The passage is a
> restatement of how macro languages in general work: tokens are expanded
> until they can't be expanded anymore and the remaining primitives or "terminal
> symbols" are then passed to the compiler.
> Ulrich is correct, primitives are not only control sequences, they are also
> plain characters, the beginning-of-group and end-of-group tokens, the
> enter-math-mode and exit-math-mode characters, etc. It's another way of
> putting what he otherwise describes as TeX's "mouth" and "stomach" (perhaps
> not his most appetizing image) --- what other people call scanning and parsing.
Thank you for spelling my first name correctly. ;-)
I think it is well possible that the statement refers to the total of about
900 control sequences of plain TeX and not to all definable macros.
!!! Detecting the incorrectness of the statement referring to this variant
of interpretation is not my merit, but Laurence Finston's. !!!
In the TeXbook it is explained that primitives are control sequences.
Chapter 3 of the TeXbook explains that there are two flavors of control
sequences: Control word tokens and control symbol tokens.
In Chapter 24 "<control sequence>" (the item in Backus-Naur notation) is
introduced as something that is either a control sequence or an
active character.
Thus the phrase "control sequences" in the statement
"About 300 of TeX's control sequences are called primitive; these are the
low-level atomic operations that are not decomposable into simpler
functions. All other control sequences are defined, ultimately, in terms
of the primitive ones. For example, \input is a primitive operation, but
\’ and \" are not; the latter are defined in terms of an \accent primitive."
clearly does not refer to explicit non-active character tokens.
(Additionally: The explanation of <definition> in chapter 24 can also
be interpreted in a way that a <control sequence> - "control sequence"
can be subsumed under <control sequence> - is something that can be
(re)defined, e.g., by \def. This is not the case for explicit non-active
character tokens).
Non-active character-tokens denote primitive actions, but these actions
don't seem to be referred to as "primitives/primitive control sequences"
in the TeXbook.
Seems an explicit non-active character token is not a control sequence
at all, thus it cannot be a primitive in the diction of the TeXbook/in
the terminology introduced in the TeXbook.
As far as I know implicit character tokens, s.th. that might come into
being via
\let<control sequence>=<explicit or implicit character token>
are <control sequences>, too, but they are not referred to as "primitives".
Probably implicit character tokens are subsumable, together with whatsoever
\...def-tokens (\chardef-tokens, \toksdef-tokens, etc) (and probably
together with undefined control sequence tokens) and the like under
the term "non-expandable non-primitive control sequences".
I am aware that it is nitpicking. But after seeing again and again
what kind of difficulties people have to get through the TeXbook - in
my unqualified opinion a masterpiece of presenting information in a very
condensed way, which many people are not used to - I am of the opinion
that if you desire to understand this book, you need to read every
phrase of it like a nitpicker. And that difficulties are avoided if
the information is presented as unambiguously as possible by means of
the terminology introduced in the TeXbook.
I myself am far from perfect at this. Which is one of the reasons why
I frequently see a need to edit my answers at TeX-LaTeX-StackExchange
and to rephrase things I wrote at (de.)comp.text.tex. Therefore I ask
you to understand my thoughts not as reproaches/accusations, but as
suggestions. ( Besides, I do not work in an field where one would
have anything to gain from raising reproaches/accusations. ;-) )
Sincerely
Ulrich
More information about the tex-k
mailing list.