[plt-scheme] Contract Error Message

From: YC (yinso.chen at gmail.com)
Date: Mon Jul 20 15:33:34 EDT 2009

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.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20090720/1a971745/attachment.html>

Posted on the users mailing list.