How about macro == symbol for mixin statement? [was Re: Member functions C to D]

Jarrett Billingsley jarrett.billingsley at
Thu Oct 8 07:11:44 PDT 2009

On Thu, Oct 8, 2009 at 4:00 AM, Don <nospam at> wrote:

>> So it looks to me like the mechanics of it are basically identical.
>> Just Nemerle's syntax is nicer.
> Only with trivial examples. With more complicated examples they look less
> identical. I'm basing my views on pages like this:
> Unless I'm totally misunderstanding this, it looks to me as though Nemerle
> macros are implemented as compiler plugins.
> All the advanced facilities are obtained by exposing the compiler's API!

Well they're not.. "plugins" per se as much as "compiled modules."
Okay yes that's basically a plugin :P But it's not that different from
D, where you use compile-time executed functions to do the same sorts
of things. It's just that you precompile those functions instead of
having the compiler "compile" them on every compilation.

But really, I don't see how this is significantly different from
hooking into the D compiler's internals with __traits, .stringof,
.mangleof and the like. So it uses an object-oriented API to access
those things instead of ad-hoc hacks. And? I don't know how you can
trash Nemerle's approach while leaving D's unmentioned.

More information about the Digitalmars-d-learn mailing list