[plt-scheme] contracts.ss: Can you disable them at runtime?

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Thu May 17 08:17:13 EDT 2007

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?


> Some systems allow disabling selectively: preconditions,
> postconditions, invariants, and a few more that I don't recall at the
> moment.

Contracts are more and less than assertions:
  More: they come with a blame system.
  Less: you can use them only at the pre-determined boundaries  
(modules for us). See intro to FAQ.

-- Matthias



Posted on the users mailing list.