[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: .ie as target of .if

From: Tadziu Hoffmann
Subject: Re: .ie as target of .if
Date: Tue, 1 Sep 2020 13:36:36 +0200
User-agent: Mutt/1.11.4 (2019-03-13)

> .if COND1 .ie COND2 xxx
> .          el yyy

> If this is considered working as designed, however, the
> documentation ought to mention the restriction.  It currently
> implies the opposite, by saying the part after the condition
> in an .if request "is interpreted as though it was on a line
> by itself."  Were the .ie in fact on a line by itself, groff
> wouldn't grumble about the .el.

I think it is working as intended.  "ie" pushes the result
of the conditional test onto a stack ("if" does not), to be
popped by a future "el".  So if COND1 is true, that stack
contains the test result of COND2, which the "el" can use.
If COND1 is false, the "ie" is never executed, and the stack
remains empty, so "el" complains.

Note that if there had been another "ie" before your program
fragment, then your "el" would be consuming its result.
So you can create some very interesting code this way.

The documentation should say that it "is interpreted as
though it was on a line by itself IF THE CONDITION IS TRUE".
If not, it is never executed (except perhaps macro expansions
that take place while the line is being read).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]