[plt-dev] Changes to the contract system

From: Carl Eastlund (cce at ccs.neu.edu)
Date: Sat Feb 6 15:40:18 EST 2010

I have just committed a change to the contract system which provides a
new interface for constructing custom contracts, as well as a new
underlying representation for contracts to support this interface.
For the purpose of most developers, very little will change; all
existing contracts will continue to function as they have.

There are three main user-facing changes.

One, all flat contracts (other than constants, such as numbers and
strings) may now be applied as predicates.

Two, "make-proj-contract" has been replaced by "simple-contract".  The
main difference between "make-proj-contract" and "simple-contract" is
the introduction of "blame objects" which encapsulate blame tracking
into one value instead of five.

Three, arbitrary structures can now be defined as contracts using the
prop:contract or prop:flat-contract properties, instead of the five
different properties that had to be combined before.  The property for
flat contracts automatically inherits the property for regular
contracts (a flat contract is a contract) as well as the property for
procedures (a flat contract is a predicate).

I have updated the documentation to describe the new interfaces, and I
have replaced all uses of make-proj-contract in the trunk.  The legacy
bindings are now deprecated (and I have in fact removed them from the
documentation), but they continue to exist for backwards compatibility
with planet packages.


Posted on the dev mailing list.