[plt-scheme] Contracts on Libraries

From: Robby Findler (robby at cs.uchicago.edu)
Date: Sat May 26 15:06:11 EDT 2007

I think you should use contracts. If you find efficiency to be a
problem, then you might want to revisit that, but the default should
probably be to have contracts.

One thing to keep in mind is that contracts are fairly expressive and
when you start thinking about contracts you'll probably find a whole
range of invariants that you might want to express. Probably the best
thing is to start with the basic ones and add in more elaborate ones
as you get a sense of the kind of errors that people run into when
using the library.

Robby

On 5/26/07, Paulo J. Matos <pocm at soton.ac.uk> wrote:
> Hello all,
>
> I'd like some comments on addings contracts to libraries. I'm
> developing a graph library, soon on planet, which on the interface
> module contains contracts on the functions the user might access.
> In my opinion this is good because it allows me to separate the code
> doing real stuff and the checks (does the function receive a struct
> and blablabla). However, I'd like to know if people agree with the use
> of contracts on libraries or if for efficiency reasons (or any other),
> think that no contracts should be used and that they should only
> appear on user code.
>
> Cheers,
>
> --
> Paulo Jorge Matos - pocm at soton.ac.uk
> http://www.personal.soton.ac.uk/pocm
> PhD Student @ ECS
> University of Southampton, UK
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>


Posted on the users mailing list.