My first email to Walter, ever

Peter Alexander peter.alexander.au at gmail.com
Sun Jul 7 06:35:49 PDT 2013


On Sunday, 7 July 2013 at 13:20:14 UTC, Timon Gehr wrote:
> On 07/07/2013 02:27 PM, Peter Alexander wrote:
>> ...
>>
>> We're almost there with CTFE, but CTFE can only run functions 
>> that could
>> run at runtime. In a crazy world where types were first class 
>> objects,
>> stuff like this would be feasible. Or perhaps we just need a
>> compile-time metalanguage that allows things like this to be 
>> run with CTFE?
>
> Almost there indeed.
>
> http://d.puremagic.com/issues/show_bug.cgi?id=9945

Hmmm.... I was thinking about encoding/decoding types, but it 
doesn't help with template instantiations. You still need a 
separate compile time language.

bool allSatisfy(alias F)(TypeInfo[] typeIds) {
     foreach(t; typeIds)
         if (!F!(__traits(typeFromId, t))) <---- How do you do 
this step?
             return false;
     return true;
}

Or am I missing something?


More information about the Digitalmars-d-announce mailing list