Sure, they're open to _severe_ abuse, but for the case when they are used to generate source code (eg, from a DSL), they are absolutely perfect, and not a hack at all. In that particular scenario, they are much better than AST macros could ever be.

They're a replacement for creating a text file, adding a line to your makefile in order to invoke a program to read the text file and spit out a d source file, then add another line in the makefile to compile that d file, then link it in, and try to integrate the whole thing seamlessly. They're a beautiful solution to a really ugly problem.

It's not fair to regard them simply as a hack to get around language limitations.

@Walter - please add this perfect description to the mixin page ;-)

Reply via email to