Don:

I don't think contracts can be much use to a static analyzer if they can contain arbitrary code.

The other contract systems I know of (Eiffel, Ada, C#, Sing#), plus few other systems that use the type system for similar reasons (Liquid Haskell, etc), use a very restricted expression language to state contracts. D is the only that uses free form D code.

I presented this problem to Walter lot of time ago in a post. He answered me that analysing a loop is not harder than analysing the all/any/exists used in those systems. I was never convinced by that.

I still think there's one D design problem here.

Bye,
bearophile

Reply via email to