DIP 50 - AST macros

Rikki Cattermole alphaglosined at gmail.com
Mon Nov 11 04:36:12 PST 2013


On Monday, 11 November 2013 at 12:30:07 UTC, Jacob Carlborg wrote:
> Yes, I still don't understand why you would want it as a 
> pragma. Be usable outside of macros?

Yes outside of macros would be useful. For example code like this 
would become redundant:
pragma(msg, "Support for x is not implemented on platform y");
static assert(0);

Becoming:
pragma(error, "Support for x is not implemented on platform y");

Also pragma's core responsibility is to cause the compiler to do 
something. In this case to say we hit an error during compilation 
please tell the user/dev and die.

It is a hook to the compilers workings.

Currently working on getting this implemented. Nearly done with 
it. Just got some extra spaces that shouldn't be in output.


More information about the Digitalmars-d mailing list