[tex-live] Bug?: pdflatex hangs with self-referential \newcommand{\bad}{\bad} definition

Jess Riedel jessriedel at gmail.com
Wed Jan 9 18:25:52 CET 2019


The point about pdftex not being able to solve the halting problem is well
taken. I guess the only counterargument is that some easy checks could be
made, like compilers that warn the user that if(x=1) probably should be
if(x==1). But there are always speed and maintenance costs to having a
bunch of checks, and I trust y'all's judgement.

Thanks very much for the thorough answer.

On Wed, Jan 9, 2019, 11:21 AM Zdenek Wagner <zdenek.wagner at gmail.com wrote:

> The problem with \newcommand{\bad}{\bad} is that it is a tail
> expansion, this means that it does not eat stack, it just loops
> forever.  \newcommand{\bad}{\bad x} will probably report stack
> overflow. It is documented in The TeXbook.
>
> Zdeněk Wagner
> http://ttsm.icpf.cas.cz/team/wagner.shtml
> http://icebearsoft.euweb.cz
>
> st 9. 1. 2019 v 17:09 odesílatel Philip Taylor <P.Taylor at rhul.ac.uk>
> napsal:
> >
> > David Carlisle wrote:
> > > This plain tex document also loops
> > >
> > > \let\par\relax x\vfill
> >
> > This one is more fun:
> >
> >         \tracingall \let \par = \relax x \vfill
> >
> > ** Phil.
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/tex-live/attachments/20190109/d31af481/attachment.html>


More information about the tex-live mailing list