Proposal: Replace __traits and is(typeof(XXX)) with a 'magic namespace'.

Bill Baxter wbaxter at gmail.com
Tue Nov 3 10:16:00 PST 2009


On Tue, Nov 3, 2009 at 8:52 AM, Don <nospam at nospam.com> wrote:
> Andrei Alexandrescu wrote:
>>
>> rmcguire wrote:
>>>
>>> It makes a lot of sense to just say to someone "if you want to do
>>> something at  compile time, just check the 'static' documentation".
>>
>> I agree. And goes with static if too.
>>
>> Andrei
>
> Unfortunately static if, static variables, and static member functions don't
> seem to have much in common with each other. You have to be quite
> imaginative to find a common theme.

I think static variables and static member functions (the classic
C/C++ statics) would stay as-is.

I could go either way, though.  I don't particularly care about adding
a keyword if it's going to carry it's weight.  And I think this one
will.   meta.if  meta.foreach  meta.assert all seem ok to me.  I also
think having a keyword dedicated to compile-time operations sends a
clear message that the language is serious about making compile-time a
first-class citizen.

--bb



More information about the Digitalmars-d mailing list