views:

83

answers:

2

The title pretty much sums up the gist.

I'm interested in whether it is possible to enable/disable contract enforcement(s) when using a dynamic language without running a serious risk of poorly/un-diagnosed failure?

If not, the crux seems (to me) to be that any enforcements are a required part of the component's logic, rather than optional/removable as per the spirit of removability of DbC's enforcements.

+3  A: 

Not only is it possible, there are real-world implementations of this and they've been around for years. Here's a DbC implementation for Python that's twelve years old, for example.

John Feminella
From the abstract, that looks like it doesnt support full DbC. Presumably it doesn't support the "old" value?
Paul Biggar
+2  A: 

I believe lisp has a good design by contract framework.

http://www.cl-user.net/asp/OkD82/sdataQkIGW7mlSHARDQ3r-H8X8yBX8yBXnMq=/sdataQu3F$sSHnB==

Berlin Brown