[plt-scheme] contracts.ss: Can you disable them at runtime?
On May 17, 2007, at 9:41 AM, Richard Cobbe wrote:
> On Thu, May 17, 2007 at 08:17:13AM -0400, Matthias Felleisen wrote:
>>
>> On May 17, 2007, at 12:05 AM, Grant Rettke wrote:
>>
>>> Can you disable contracts at runtime?
>>
>> Short: No. (I assume you mean "after deployment" because
>> contracts are
>> inherently a run-time concept, i.e., they are what your type
>> system can't
>> express.)
>>
>> Long: Tony Hoare once said that assertions are like life vests.
>> Why use
>> them on land during practice and leave them back when you go to sea?
>
> I've often wanted to disable them for certain modules even "during
> practice." When I'm running test cases and debugging, having to
> repeatedly
> recompile a module with complicated structure and contract
> definitions is
> slow enough to be very annoying and almost slow enough to be
> impractical.
It sounds like you're using contracts as a substitute for types and a
pre-optimization experience. -- Matthias