Follow-up Comment #1, bug #68097 (group groff):

[comment #0 original submission:]
> I would add that these new Boolean semantics would also make it possible for
> _groff mm_ to extend the interface of such macros with further arguments in a
> backward-compatible way; using these semantics, you could say "0" (or, since
> this is *roff, a negative number) to retain a macro's default behavior in the
> respect governed by that argument, while other arguments could still follow.
> With the traditional semantics, this is impossible because even an empty
> argument is "there" for the purpose of the argument count.  So there's no way
> tell _mm_ to ignore or skip over it.

That last statement is incorrect.

You **could** retain "presence-only" semantics for a "final argument" under
the DWB _mm_ API, but then _change_ those semantics if _yet further arguments
are present_.  This would still require a logic change to the macro package.

So, in pseudocode, where we now have:

if argument-count > 2
  do special thing
end if

...we could instead have the following.

if argument-count = 2
  do special thing
else if argument-count > 2
  if argument(2) # Boolean test
    do special thing
  end if
end if

...but I've fulminated before, likely to the point of tedium, about what I
regard as the poor wisdom of using weak type systems in programming
languages.

I think it would be a bad idea to have _mm_ macro arguments take on Boolean
semantics **only if followed by other arguments**.

But, in full frankness, I have to concede that the weak-typing alternative is
_possible_.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?68097>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature

Reply via email to