Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!lll-winken!uunet!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!midway!ux1.cso.uiuc.edu!csrd.uiuc.edu!s41.csrd.uiuc.edu!eijkhout From: eijkhout@s41.csrd.uiuc.edu (Victor Eijkhout) Newsgroups: comp.text.tex Subject: Re: TeX bug: optional spaces are mandatory Message-ID: <1991Feb8.232215.3129@csrd.uiuc.edu> Date: 8 Feb 91 23:22:15 GMT References: <4117@cernvax.cern.ch> Sender: news@csrd.uiuc.edu (news) Organization: UIUC Center for Supercomputing Research and Development Lines: 33 grabiner@math.harvard.edu (David Grabiner) writes: >In article <4117@cernvax.cern.ch>, Alfred Nathaniel writes: >> I discovered a bug in TeX3.0. >> In sequences >> ...\counter=\ifnum\counter... >> and >> ...\counter=\fi \ifnum\counter... >> the \ifnum test fails if is not followed by a space. >I don't think this is a bug; a similar situation is mentioned in the >TeXbook, p. 208. TeX has to expand the \ifnum to see whether the >expansion becomes part of the . For example: Correct. The second example is somewhat more surprising tho'... The TeXbook is not very explicit about how conditionals are handled, but what it boils down to is that \else and \fi are also expandable control sequences, and with an empty expansion. So \counter2=1\fi \ifnum1=1 2\fi will assign \counter2=12 ! (not factorial, but as in '``"O"o"o!!'' ``No, Aaaaargghh!!!'' '. Sorry. The Python in me coming out.) And now for the people who think the understand the above: remember that \pageno is just an abbreviation (by \countdef) of \count0. So what's the difference between \count37=1\ifodd\pageno\fi2 and \count37=1\ifodd\count0\fi2 ? Victor.