[racket] Making a contract between a function and "the world in general"

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Sun Oct 9 12:30:15 EDT 2011

On Oct 8, 2011, at 9:49 PM, Ryan Culpepper wrote:

> But in your alternative,
>  (provide (contract-out [f contract-of-f]))
> the contract of f is *still* not manifest in the module. Instead of chasing down f, we have to chase down contract-of-f. We've also duplicated code/knowledge (the association between f and contract-of-f) with all the problems that entails. Also, we've cluttered up the namespace with these contract-of-* bindings.

Perhaps you are right. Perhaps we should go even further and every 're-provide' should implicitly propagate contracts. 

> Of course, duplicating the contract expression would make it manifest, but it would aggravate the ill effects from code duplication. My experience: partly because of its lazy-require tricks, the db library has some duplication of contracts, and I hate it. I've also eliminated internal contracts to avoid having to repeat them in the externally-visible modules.

I consider that last part *good*. So perhaps it did push you in the right direction. 

-- Matthias

Posted on the users mailing list.