Proposal to add 'Elements of Programming' Concepts to std.traits

bearophile bearophileHUGS at lycos.com
Sat Jun 16 14:33:10 PDT 2012


Guillaume Chatelet:

> It's pretty close. For what I understood of x10 (I'm not using 
> it yet just interested in the language) the compiler will also
> enforce the invariance at compile time not solely at runtime. ie
>
> void main(){
>   NoZero a = 0; // shouldn't compile
> }

I have proposed an idea to do something related in D (it's about 
pre-conditions, not invariants, but this is an easy problem to 
solve, adding assign/read methods to that NoZero, and giving them 
pre-conditions):

http://d.puremagic.com/issues/show_bug.cgi?id=5906

Bye,
bearophile


More information about the Digitalmars-d mailing list