[racket-dev] Announcing Soft Contract Verification tool

From: Benjamin Greenman (blg59 at cornell.edu)
Date: Sun Jan 18 20:38:05 EST 2015

On Sun, Jan 18, 2015 at 9:44 AM, Greg Hendershott <greghendershott at gmail.com
> wrote:

> Is there a similarly simple/standard way to disable contracts?

I'd love a #lang like that. Never mind Tony Hoare's metaphor about sailing.
For now, I'm attaching a small patch that'll disable contracts (as far as I
can tell) on the current build; it's adapted from Leif's commits at [1].

;; ---

Please keep the bug reports coming!

It looks like the built-in function expt isn't defined correctly:

(module f racket
  (provide (contract-out [f (integer? . -> . integer?)]))
  (define (f n)
    (expt n n)))

Contract violation: 'f' violates 'expt'.
Wrong arity
An example module that breaks it:
  (module user racket (require (submid ".." f)) (f 0))

  (verification takes 0.035s)

[1] https://github.com/LeifAndersen/racket/tree/no-conracts
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/dev/archive/attachments/20150118/e93298df/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nerf-contracts.patch
Type: text/x-patch
Size: 7879 bytes
Desc: not available
URL: <http://lists.racket-lang.org/dev/archive/attachments/20150118/e93298df/attachment.bin>

Posted on the dev mailing list.