[plt-scheme] Looking for suggestions on how to approach an issue

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Thu Sep 17 20:26:55 EDT 2009

On Sep 17, 2009, at 6:53 PM, David Storrs wrote:

> Problem:
> Now that we have a working prototype, we would like to add contracts
> to guarantee the correctness of data passed into and out of our
> read-data and write-data routines.  But contracts only apply across
> module boundaries.  Since the call to 'new' is within the module where
> the read / write calls are made, we don't see how to make this work.
> We're starting to think that OO may have been the wrong approach, and
> are considering reworking the prototype.  No sacred cows--we're
> looking to optimize for programmer time.  I asked in the IRC channel
> and got two useful pointers:  typed scheme or contract regions, but it
> was also suggested to ask on list, so I'm asking.
> Any thoughts?  Anyone have experience doing anything like this?

1. At this moment you have two choices:

-- contract regions: You can break up your module into separate  
regions -- as small as a function if you really don't trust yourself --
and put contracts on values that flow from one region to another.

-- units: you can now put contracts on units & signatures, and if  
you are creating a highly dynamic system, this may be a superior choice
to contract regions.

My recommendation would be to start with regions and to add unit-based
flexibility as needed.

2. We (Stevie, Sam and I( are currently investigating the addition of
contracts to our class system. The research problem is to accommodate
first-class classes, especially mixins. Don't expect a working system
before the end of the academic year.

3. The type system for Typed Scheme currently doesn't accommodate  
yet. To do this in a sound manner, we need to finish 2.

-- Matthias

Posted on the users mailing list.