Why do both The TeXbook and latex.ltx define \z@skip=0pt plus0pt minus0pt? Wouldn't \z@skip=0pt or perhaps \z@skip=0pt\relax be shorter and yield the same? I always thought that the stretch and shrink are zero by default.
Asked
Active
Viewed 214 times
11
1 Answers
11
In plain.tex we see
\newskip\z@skip \z@skip=0pt plus0pt minus0pt
\newbox\voidb@x % permanently void box register
If it had been
\newskip\z@skip \z@skip=0pt
\newbox\voidb@x % permanently void box register
then TeX would proceed to expand \newbox and lose time just to put back tokens. And it would need the knowledge of what the expansion of \newbox is anyway.
The alternative
\newskip\z@skip \z@skip=0pt\relax
\newbox\voidb@x % permanently void box register
would avoid the expansion and produce the same result, at the expense of clarity.
In latex.ltx the part is a straight copy from plain.tex.
egreg
- 1,121,712
\relax, you can run into really strange errors arising from "some expression plus something else" becoming "0pt plus something else". But that still leaves the question of "why not just relax?") – Teepeemm Aug 29 '22 at 19:19\relaxmight hypothetically take more time than parsing and evaluatingplus0pt minus0pt. Or, perhaps, the default interpretation of absent stretch and shrink could hypothetically be changed to nonzeros. I don't really know; hence the question. – Aug 29 '22 at 19:59