[plt-scheme] Contract Error Message

YC yinso.chen at gmail.com
Mon Jul 20 16:02:34 EDT 2009


On Mon, Jul 20, 2009 at 12:46 PM, Carl Eastlund <carl.eastlund at gmail.com>wrote:

>
> No, or/c is not a higher order contract.  It is a higher order
> function that produces a (possibly higher-order) contract.
>
> A higher order contract is one that wraps a function and delays
> contract checking to function application time.  For instance,
> (string? integer? . -> . string?) is a contract one could give to
> substring.  It can't check the inputs and outputs right away (as there
> are none inherent in the function), so it "wraps" the function.  It
> checks the inputs on each entry to the function and the outputs on
> each exit.  If the input or output contracts are themselves
> higher-order, those values are similarly "wrapped".


Thanks for the correction - I guess or/c should be called a composite
contract then?  I followed the reasoning that a higher order function is a
function that takes other functions as parameters and hence a higher order
contract is one that takes other contracts.

Cheers,
yc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090720/788fa2a8/attachment.htm


More information about the plt-scheme mailing list