Will macros just be syntactic sugar?

Don Clugston dac at nospam.com.au
Wed Apr 25 04:21:03 PDT 2007


Davidl wrote:
> how to emit a error message by CTFE if arg0 is not an
> identifier?

assert(isIdentifier(arg[0]), "Identifier expected");

The error message even indicates the line of user's code where the error 
occurs (doesn't refer to the line in the macro).

and compiling that CTFE library would be pretty
> much slower compared to my version.
Yes, but the speed comes from Token; otherwise, they're pretty much the 
same.
> And the advantage of macro is the frontend parser can help
> IDE for auto-completion.

Naturally.



More information about the Digitalmars-d mailing list