soft-contract icon indicating copy to clipboard operation
soft-contract copied to clipboard

Handle error function

Open dvanhorn opened this issue 10 years ago • 2 comments

This program should not verify (error is currently unbound):

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

Does it work just to give error a ... -> none/c contract?

dvanhorn avatar Jan 19 '15 23:01 dvanhorn

If we take the blamed party into account:

This:

(module lib racket
  (provide/contract [error (any/c . -> . none/c)]))

will blame the module providing error, while this:

(module lib racket
  (provide/contract [error (none/c . -> . any/c)]))

will blame whoever calling error. Is the second closer to what we want?

philnguyen avatar Jan 20 '15 00:01 philnguyen

There are some deep questions about what we want here, but I think we want no one to be blamed, at least to start.

samth avatar Jan 20 '15 01:01 samth