[texhax] Strange \loop-behaviour

Ulrike Fischer news3 at nililand.de
Tue Jun 2 09:17:54 CEST 2009


Am Mon, 1 Jun 2009 20:37:05 +0200 schrieb Reiner Durchholz:

> This is a report of what I believe is a flaw in the "\loop"  
> implementation.
> The appended source text behaves differently with and without the  
> \null-command.
> Instead of \null, almost any other command can be used.

> \ifeof1\more=0\fi
> \null % without this command, the loop either does not end or ends  

A \fi doesn't unterrupt the assignment to the counter more. TeX
continues to read/expand commands to find more numbers. You can even
use \if-commands inside the assignment:

\newcount\more \more=1 % 

\ifx aa \more=0\fi 2
\the\more

\more=1\ifnum3=4 5\else6\fi7
\the\more
\bye

To stop the assignment, use \relax \more=0\relax 
or a space:  \more=0 \fi  

-- 
Ulrike Fischer 



More information about the texhax mailing list