[plt-scheme] Contract Error Message
On Mon, Jul 20, 2009 at 12:22 PM, David Van Horn <dvanhorn at ccs.neu.edu>wrote:
> YC wrote:
>
> I am a happy user of the current contract system and would hate to see this
>> change. Constants are a perfectly valid contract and why should they not be
>> accepted in a higher order contract? This would seriously curtail the
>> expressiveness of the contract system, not to mention create two separate
>> rules to remember.
>>
>
> I don't want to change the contract language, so I must be confused about
> what a "higher-order" contract is -- which I guessed was anything
> satisfying:
>
> (lambda (x)
> (and (contract? x)
> (not (flat-contract? x)))
>
> But it seems the bug here is actually in the docs.
>
> "Takes any number of predicates and higher-order contracts"
>
> The higher-order part should be dropped, right?
>
I agree that the doc seem ambiguous on the higher contract point. IIUC, or/c
is a higher order contract itself, and accepts regular contracts (including
constants, predicates, flat contracts) and higher order contracts such as
another or/c, listof, etc.
Cheers,
yc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20090720/1a971745/attachment.html>