A question about DbC

Jonathan M Davis jmdavisProg at gmx.com
Sat Oct 9 03:20:18 PDT 2010


On Saturday 09 October 2010 03:09:30 Denis Koroskin wrote:
> Given that pre-, post-conditions and invariants are all pure, it doesn't
> really matter in what order they are executed.

In effect yes, but they aren't actually pure. If they were, you couldn't use stuff 
like writeln() in them. However, since they go away in release builds and aren't 
supposed to have any effect on the program (beyond throwing AssertErrors on 
failed assertions), they are in effect pure, so you're essentially correct. But 
still, they aren't actually pure.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list