Pre-conditions at compile-time with static arguments

bearophile bearophileHUGS at lycos.com
Mon Apr 25 16:25:33 PDT 2011


KennyTM~:

> Also, if the precondition were complaining, and you change some bit of 
> the code and find it can be compiled -- that won't mean anything, as it 
> is likely the change just make the precondition non-CTFE-able.

You are right, this is bad. But the compile-time interpreter is getting able to run a larger percentage of D code, so that problem becomes smaller, and this idea doesn't give false positives.


> I also don't believe this still keeps the compiler simple,

It's _way_ simpler than solutions like one in Sing#. Here you don't need a powerful symbolic constraint solver inside the compiler :-) All the needed tools are already present.

Bye,
bearophile


More information about the Digitalmars-d mailing list