groff
[Top][All Lists]
Advanced

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

Re: [Groff] condition: OR of two string comparisons


From: Ralph Corderoy
Subject: Re: [Groff] condition: OR of two string comparisons
Date: Mon, 17 Nov 2014 16:36:54 +0000

Hi Werner,

> > Would it?  That form could reject backwards compatibility;  only new
> > format allowed, just as after .iff.  I don't see why old syntax has
> > to be handled if it currently makes no sense to use `E' after the
> > `('.
> 
> Well, using (E;...) everywhere is tedious.

True.  Denis has a point though, it would be nice to use new syntax for
things like `.nr'.

> Maybe it makes more sense to have the slightly more verbose
> 
>   .iff
>   .then
>   .else
> 
> so that we can avoid excessive parentheses – the `.then' keyword would
> be the sentinel to stop the conditional expression.  Alternatively, we
> could mandate to always use braces:
> 
>   .iff ... \{\
>   .\}
>   .else \{\
>   .\}

I'd favour mandatory braces and no parenthesis around the condition.
Must we keep the cluttered `\{\' with the new syntax?  What if the open
brace indicated multi-line format and the else/elsif has to be on the
closing `.}' line?

    .iff ... {
    foo\c
    .}

    .iff ... {
    foo\c
    .} else {
    bar\c
    .}

    .iff ... {
    foo\c
    .} elsif ... {
    bar\c
    .} else {
    xyzzy\c
    .}

Could a single-line .iff give new syntax for the brief else/elsif-less
case?  Leading spaces after the colon would be swallowed, as with
existing `.if'.

    .iff ...: foo\c

Cheers, Ralph.



reply via email to

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