How about macro == symbol for mixin statement? [was Re: Member functions C to D]
jarrett.billingsley at gmail.com
Wed Oct 7 10:18:11 PDT 2009
On Wed, Oct 7, 2009 at 11:21 AM, Don <nospam at nospam.com> wrote:
> Steven Schveighoffer wrote:
>> On Wed, 07 Oct 2009 09:17:59 -0400, Jarrett Billingsley
>> <jarrett.billingsley at gmail.com> wrote:
>>> It's also insanely kludgy and ugly. Bleh.
> Ugly, yes. Kludgy, I don't think so. It's only a syntax issue. The basic
> concept of passing meta-code to the compiler in the form of raw text is
> mixin() if you want to insert something into the parse step.
> is(typeof()) if you want to catch it again after the syntax pass.
> stringof if you want to catch it again after the semantic pass.
> And that's all. The syntax is ugly, but the semantics are beautifully
It'd be nice if they actually worked. is(typeof()) fails for *any*
error, and it eats those errors too, so if your code fails to compile
for some reason other than the one you're testing for, welp, good luck
figuring that out. And don't even get me started on .stringof.
Also, see my post on the "get template and its instantiation
parameters" thread for my detailed opinion on them.
> By contrast, something like Nemerle macros are a kludge. The idea of
> providing a 'hook' into the compiler is a horrible hack. It exposes all
> kinds of compiler internals. Yes, it has nicer syntax.
I.. don't even know how to begin to respond to that.
More information about the Digitalmars-d-learn