On Wed, Apr 07, 2021 at 09:58:08AM -0700, Mr. Clif wrote:
So not finding anything like this, I wrote some that seem to work pretty
well. Here they are:
http://www.eugeneweb.com/wiki/Sites/M4Macros
Thanks for the link.
I defined the names without the #'s eg. IF, ELSE, ENDIF, etc... Also M4
requires parentheses to hold the arguments where CPP does not (at least for
most of these). I also added a selective invoke, to protect macros with side
effects from invocation in an unselected block.
I was wondering if they pass muster, if the devs might consider including
them or something similar in M4's list of examples.
Right now, the code in m4/examples is limited to things mentioned in
the manual; it may be worth considering additional examples, but
distributing them as part of the m4 tarball would require proper FSF
copyright assignment. Certainly not something that will happen in
time for the pending 1.4.19 release, but if there is didactic value in
your macros that is not already covered in the manual, it may be worth
future consideration.