Boo has some support for Design by Contract with the Required attribute.
def doit([required(x >= 0)] x as int): print x doit(10) doit(0) doit(-1) //raises a System.ArgumentException
Since boo has an extensible compiler architecture (unlike for example C# or VB.NET), it is possible to eventually add more complete Design By Contract functionality to boo, by creating custom compiler macros, attributes, and pipelines.
Here are some other custom languages for .NET and Mono that include DbC features that we might check out:
- Eiffel.NET - most complete DbC functionality, although it does all checks at runtime I think, and you don't have an option to turn off some of the checks at compile time I believe
- Nemerle - is implementing DbC features, I think trying to follow how Spec# and Chrome do it
- Spec# - a Microsoft research project
- Chrome - object pascal compiler
- Extensible C#