[plt-scheme] Disabling contract checking

From: Lauri Alanko (la at iki.fi)
Date: Mon Apr 10 14:06:47 EDT 2006

Contracts, though stupendously expressive, are still essentially just
"assert" on steroids. However, the reason why assertions are so
ubiquitously popular is that they can be disabled in production code,
removing all overhead. But am I blind, or is there really no such option
for contract.ss? Why?

I know that the theory is that contracts are placed only on inter-module
boundaries, and that inter-module boundaries are not crossed too often,
but neither of these is always true, so the unability to disable
contracts discourages one from placing precise contracts on
performance-critical functions. This seems like a shame.

What, in any case, would be the proper way to implement a compile-time
option such as this? A transformation-time parameter value? Or perhaps a
custom classloader that provides an alternate version of a
macro-defining module?


Lauri


Posted on the users mailing list.