[plt-scheme] function contracts

From: Richard C. Cobbe (cobbe at ccs.neu.edu)
Date: Thu Mar 11 08:15:30 EST 2004

Lo, on Thursday, March 11, Zhu Chongkai did write:

>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> >
> >Is it possible to define a function contract that will cause some
> >constraint to hold between the arguments of the function?  For
> >example a function might require two integer arguments where the
> >first must be less than the second.  I couldn't see how to do this
> >from reading the documentation.
> DrScheme treat contract as *comments*. The purpose of writing commentary text 
> is to help people (both writer and reader) to understand the code. 

Unfortunately, we've overloaded the term `contract.'  HtDP uses it in
the sense you describe, but the word also refers to a language form that
does impose checked constraints on your program.  See the documentation
for contract.ss (part of MzLib) in the help desk.


Posted on the users mailing list.