I'll chime in only because some of the usual suspects who could best
answer this might be busy with the Racket summer school this week.


I believe that function contracts can be about as fast as the sort of
checks you'd code by hand, provided that:

- The parameter contracts are simple, flat, first-order predicates like
  `string?` and combinators thereof like `(or/c number? string?)` or
  `(and/c number? positive?)`.

- The return value is `any` -- not even `any/c`, just `any`. Effectively
  don't check the return value(s).

If callers already have contracts that will check the value as it is
used, then maybe the only thing a non-`any` return value contract would
get you is more precise blame in the error message. Whether that is
worth the probably somewhat slower speed, is your choice.


If you want the contact to protect the function itself, not merely
as-provided by a module, you can use `define/contract`.

You could also move some definitions into a sub-module, and contract the
provide from there.

In any case, the nice thing is that you can use or create any boundary
you prefer to put the contract on.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/87tvbwpafx.fsf%40greghendershott.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to