[plt-scheme] Contract Error Message

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Mon Jul 20 18:48:56 EDT 2009

The phrase "higher-order contract" refers to contracts on higher order
functions, altho your interpretation of the words is a reasonable one,
it is not the one used in the manual.

Looks like or/c's documentation is wrong: it should just say
"contract". I've fixed that in SVN.

The only fix I can imagine that would have helped Paulo in the first
place is if or/c insisted on taking at least two arguments, but I'm
not sure that making that change would be a good idea.

Robby

On Mon, Jul 20, 2009 at 3:02 PM, YC<yinso.chen at gmail.com> wrote:
> 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
>
>
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
>


Posted on the users mailing list.