$(DDOC $(DDOC_BLANKLINE ) $(DDOC_BLANKLINE ) $(SPEC_S Contract Programming, $(DDOC_BLANKLINE ) $(HEADERNAV_TOC $(HEADERNAV_ITEM assert_contracts, Assert Contract) $(HEADERNAV_ITEM pre_post_contracts, Pre and Post Contracts) $(HEADERNAV_ITEM Invariants, Invariants) $(HEADERNAV_ITEM references, References) ) $(DDOC_BLANKLINE ) $(P Contracts enable specifying conditions that must hold true when the flow of runtime execution reaches the contract. If a contract is not true, then the program is assumed to have entered an undefined state.) $(DDOC_BLANKLINE ) $(RATIONALE $(P Building contract support into the language provides:) $(DDOC_BLANKLINE ) $(OL $(LI a consistent look and feel for the contracts) $(LI tool support) $(LI the implementation can generate better code using information gathered from the contracts) $(LI easier management and enforcement of contracts) $(LI handling of contract inheritance) ) ) $(DDOC_BLANKLINE ) $(HTMLTAG3V img, src="$(ROOT_DIR )images/d4.gif" style="max-width:100%" alt="Contracts make D bug resistant" border="0") $(DDOC_BLANKLINE )

$(LNAME2 assert_contracts, Assert Contract)

$(DDOC_BLANKLINE ) $(P See $(GLINK2 expression, AssertExpression).) $(DDOC_BLANKLINE )

$(LNAME2 pre_post_contracts, Pre and Post Contracts)

$(DDOC_BLANKLINE ) $(P See:) $(UL $(LI $(DDSUBLINK spec/function, preconditions, $(D in) contracts).) $(LI $(DDSUBLINK spec/function, postconditions, $(D out) contracts). $(DDOC_BLANKLINE ) ) )

$(LNAME2 Invariants, Invariants)

$(DDOC_BLANKLINE ) $(P See $(DDSUBLINK spec/struct, Invariant, Struct Invariants) and $(DDSUBLINK spec/class, invariants, Class Invariants).) $(DDOC_BLANKLINE ) $(DDOC_BLANKLINE )

$(LNAME2 references, References)

$(DDOC_BLANKLINE ) $(LIST $(LINK2 https://web.archive.org/web/20080919174640/http://people.cs.uchicago.edu/~robby/contract-reading-list/, Contracts Reading List), $(LINK2 http://jan.newmarch.name/java/contracts/paper-long.html, Adding Contracts to Java) ) $(DDOC_BLANKLINE ) $(SPEC_SUBNAV_PREV_NEXT template-mixin, Template Mixins, version, Conditional Compilation) ) )