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: Steffen Nurpmeso
Subject: Re: [Groff] condition: OR of two string comparisons
Date: Sat, 22 Nov 2014 21:45:33 +0100
User-agent: s-nail v14.7.8-74-gaaa0acd

Ralph Corderoy <address@hidden> wrote:
 |I'm interested in better expressions, string and numeric.  It's poor
 |string expressions that got us into this via 'c'a'b'c'd'e'.

I'm wondering a bit since your current interim and part-time
favorite Python supports ask-me-the-name-for-it sequences:

        elif o in ('-h', '--help'):

What about $,'a','b','c','d' or $,'a'b','c','d' instead.
See for mdocmx(7) i have to write

  . ie     'Ar'\$1' .
  . el .ie 'Cm'\$1' .
  . el .ie 'Dv'\$1' .
  . el .ie 'Er'\$1' .
  ...
  . el \{\
  .   ds doc-mx-arx\n[doc-mx-ard]
  .   return
  . \}

And this would be terrible and expensive even with || and &&:

  .if $ 'Ar'\$1' || 'Cm'\$1' || 'Dv'\$1' || 'Er'\$1' || ...

But rather easy and cheap with a sequence:

  .if $'\$1'Ar'Cm'Dv'Er'...$

  .if $ ,'\$1', 'Ar', 'Cm', 'Dv', 'Er'...

Whatever... :(
I don't know, but i really think that the new syntax should be
general and apply to all places where expressions can be used.
I still think a single glance should make it clear that the
expression uses some new syntax, and a symbol character seems to
be more logical for that than anything else to me.
The good thing about this trigger is also that the syntax can be
extended iteratively, adding ||, && etc. over time.

--steffen




reply via email to

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