[racket] contracts questions

From: Kevin Forchione (lysseus at gmail.com)
Date: Fri Aug 22 00:44:36 EDT 2014

On Aug 20, 2014, at 7:31 PM, Robby Findler <robby at eecs.northwestern.edu> wrote:

> Kevin: one thing to keep in mind when working with contracts is that
> they come with a notion of a boundary -- this is critical for proper
> blame assignment; without being able to divide up your program into
> different pieces, blame assignment cannot point to a specific piece.
> 
> When you use define/contract, the boundary is drawn around that single
> definition, excluding the rest of the file. When you use
> 'contract-out' in a provide, the boundary is drawn around the entire
> module. Usually, but not always, the module is a more natural
> division, especially if you keep your modules relatively small.
> 
> This is why you didn't see any contract checking at the REPL with the
> code from your earlier message; the REPL counts as "inside” the 
> module.

Thanks for pointing that out. After further reading and some experimenting with both contract-out and define/contract I see what is meant about the boundaries and the “blame” and have moved my contracts into the provide as it would provide the level of feedback I desire. Fantastic!

-Kevin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20140821/ed16e86c/attachment-0001.html>

Posted on the users mailing list.