[racket] Whats the difference between a predicate and a flat contract?
On Tue, Dec 4, 2012 at 7:49 PM, Robby Findler
<robby at eecs.northwestern.edu>wrote:
> Flat contracts includes more things than contracts. For example:
>
> [robby at yanpu] ~/git/plt/collects/scribblings/reference$ racket
> Welcome to Racket v5.3.1.9.
> > (flat-contract? 'x)
> #t
> > (procedure? 'x)
> #f
>
> The flat-contract function is a holdover from the days when flat contracts
> weren't able to be used directly as predicate functions.
>
> I'll push a clarification to the docs for flat-contract.
>
Isn't that the wrong way around? The flat-contract function lets you use a
predicate as a contract, not a contract as a predicate. Presumably it's
from before predicates could be used as contracts, although I hadn't
realized there was such a time.
--Carl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20121204/806ad3b6/attachment-0001.html>