DIP 50 - AST macros

Jacob Carlborg doob at me.com
Mon Nov 11 02:19:48 PST 2013


On 2013-11-11 11:11, Rikki Cattermole wrote:

> For errors I was thinking a new pragma.
> pragma(error, "You did x wrong");
> This would fire an error and display the text given. Returning error
> code as expected. It is after all in the same league as msg.
> It would also remove our current static asserts in our code.
> So other words it could be replicated by:
>
> pragma(msg, "You did x wrong");
> static assert(0);
>
> Just without the whole failed assert message.

I like the context parameter better. I'm imagine the context parameter 
containing a lot of information and functionality to interact with the 
compiler. A pragma seems not be general enough.

> Although what I was showing was the idea of overloading of macros like
> we have in templates.

Ok, I see.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list