passing a parenthesis character

Denis Valois <[email protected]> Thu, 8 Mar 2018 22:29:58 +0100
Newsgroups gmane.comp.gnu.m4.general
Message-ID <[email protected]>
Hello m4 wizards,

My problem is passing a single parenthesis as a macro argument.  I do
not understand m4 behavior; this tells me that I miss some fundamentals.

example 1:  notice the litteral `('
    index(`abcdef', `(')
this works perfectly with the expected results -1.

example 2: use of a macro
    define(`c', `(')
    index(`abcdef', c)
Here we have "ERROR: end of file in argument list".  This is because the
macro c is expanded before index so the parenthesis are unbalanced.

Other approaches such as
    builtin(`index', `abcdef', `c')
are either expanding to a wrong result or generate a run-time error.  I
simply do not see how to pass a macro defined with a parenthesis as
argument.

Thanks in advance for help.

-- 
Denis Valois/
PGP KeyID 0xB5418E1A