[plt-scheme] recent changes to contracts in SVN

From: Robby Findler (robby at cs.uchicago.edu)
Date: Tue Jul 11 22:17:53 EDT 2006

For details on using the intermediate releases, see

  http://svn.plt-scheme.org/

This is a summary of my recent changes to PLT Scheme in the SVN
archive. You may have some of these changes already; typically each
change is committed as it happens and these emails are only sent when
the list gets long enough.

  . the or/c contract now accepts multiple higher-order
    contracts, as long as they can be distinguished by some
    first-order property (for example, the arity of the
    function).

  . failures of the first-order aspects of contracts are now
    checked in the module that provides, not just the
    requiring module. This means that this module:

    (module m mzscheme 
      (require (lib "contract.ss"))
      (provide/contact [f (-> integer? integer?)])
      (define (f x y) x))

    will signal an error as soon as it is required, rather
    than waiting for a variable reference to `f' (as it used
    to).

  . rewrote some of the internals of the contract library to
    get a factor of 2 speedup for tight loops that do a lot
    of contract checking (FWIW, I had introduced this
    slowdown a few months ago in an attempt to optimize ...)

Robby



Posted on the users mailing list.