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

Reply via email to