Parens to avoid CPP macros in foreign imports
cwitty at newtonlabs.com
Thu Apr 8 12:38:13 EDT 2004
On Thu, 2004-04-08 at 08:57, Sven Panne wrote:
> Carl Witty wrote:
> > and I certainly disagree that a cast in the macro would be better. [...]
> If CPP was able to "hygienically" (term borrowed from Scheme people) generate
> fresh identifiers, an assignment to a new temporary variable and using that
> would be the way to go. But this is essentially equivalent to an "inline"
> function (the sane way to go nowadays). But for compilers without "inline"
> and a normal CPP, a cast is the only way if one insists on a macro. Making
> the typing tighter breaks an API, which is BTW the reason why "const" is
> making its way only slowly into legacy APIs, even if it's very desirable.
I agree that the macros would be "broken" if they were documented as
functions; but they are documented as "may be macros", and I'm guessing
they've been implemented as macros for the past 20 years. If this is
the case, I don't think the macros "break an API".
More information about the Cvs-ghc