[plt-scheme] Contracts on Libraries

From: Dave Gurnell (d.j.gurnell at gmail.com)
Date: Fri Jun 8 11:24:59 EDT 2007

>> efficiency
>> shouldn't be too bad.  Scheme already has safety checks on many
>> operations; as far as I'm concerned adding new checks to new
>> operations is just standard overhead.
>>
>> If you have a really speed-sensitive library, you could always expose
>> both the contracted and uncontracted modules and let users choose.
>
> Which is pretty much the same thing as having contracts you can turn
> on and off =).
>
> I see demand.

I use contracts like I used to use assertions in C and Java, so I'm  
kind of in favour of allowing them to be en/disabled. I see there is  
code in contract.ss that can be uncommented to disable contracts.  
Speaking purely in terms of feasibility, is there a way contract.ss  
could be written so it switched definitions based on, say, a flag to  
mzc or mzscheme or an environment variable?

-- Dave 


Posted on the users mailing list.