Will macros just be syntactic sugar?

Davidl Davidl at 126.com
Wed Apr 25 05:37:13 PDT 2007


heh, mixin an assert is bad, compile time is even longer :p
Though you are kinda sticking with CTFE & mixin , I'm pretty
sure you would vote my syntax of macro for macro, right? :)

> 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