A problem with D contracts

bearophile bearophileHUGS at lycos.com
Sun Aug 1 04:50:35 PDT 2010


Walter Bright:
> It is not easier to statically analyze a forall rather than a foreach.

The problem is that you can put any kind of code inside D contracts, this will make them them very to analyse automatically. The restricted semantics is a way to avoid this.


> I also see no evidence that foreach is more bug-prone than a forall would be.

I have used Python lazy/eager list comps, and I think they decrease bug-count and speed-up coding. In the past I have explained why (mostly because of psychological chunking).

Bye,
bearophile


More information about the Digitalmars-d mailing list