Hi,

DMD currently has two keywords (AFAIK) starting with double
underscore: __traits and __gshared, and additionally, __ctfe (though
it isn't really a keyword)

>From what I can understand, they are implementation-dependent, and
thus not necessarily available in all compilers. This is reasonable
enough, but presently, there is no universal way to detect whether the
keywords are available. That means that any code that uses them simply
relies on the compiler having them, period. I don't think this is
optimal, nor is it good language design IMHO.

I think we need to have version identifiers that indicate whether they
are available, e.g.:

version (__traits)
{
    enum compiles = __traits(compiles, { ... });
}
else
{
    // Fall back to some other mechanism, perhaps some feature
provided by a non-DMD compiler...
}

Thoughts on this?

Regards,
Alex
_______________________________________________
dmd-internals mailing list
[email protected]
http://lists.puremagic.com/mailman/listinfo/dmd-internals

Reply via email to