DIP 50 - AST macros

Jacob Carlborg doob at me.com
Wed Nov 13 00:06:18 PST 2013


On 2013-11-12 19:01, Rob T wrote:

> My personal main need for macros at this point, is to make up for a lack
> of better reflection, but as has been pointed out, it's not clear how
> macros would help anyway without access to the sort of reflection that
> I'm currently lacking.

Macros would need a reflection API to be usable.

> What we seem to be discussing, is the need to unify within D the
> abilities to perform better reflection along with a means to automate
> code generation during compile time. The current way reflection and
> mixins are done, are totally different, almost like two different
> languages with D, so it would be nice to have a more unified system that
> more closely resembles D itself.
>
> BTW, I agree with Walters concerns about AST macros. It would be ugly to
> work with code that is not comprehensible due to over use of macros that
> attempt to redefine the language into something else. OTOH there's also
> significant advantages to be able to add certain things into the
> language that are currently lacking. For example, I've experimented with
> a method of implementing co-routines that use switch statements, but
> it's very ugly to do without macro support to the point of being
> impractical.
>
> --rt


-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list