[#1816] Ruby 1.5.3 under Tru64 (Alpha)? — Clemens Hintze <clemens.hintze@...>

Hi all,

17 messages 2000/03/14

[#1989] English Ruby/Gtk Tutorial? — schneik@...

18 messages 2000/03/17

[#2241] setter() for local variables — ts <decoux@...>

18 messages 2000/03/29

[ruby-talk:02239] DBC in Ruby

From: h.fulton@...
Date: 2000-03-29 03:28:14 UTC
List: ruby-talk #2239
Andy wrote:

> Well, that brings up an interesting question.  What do
> you think about implementing Design By Contract in a 
> non-staticaly typed language such as Ruby?  I've toyed around
> with several implementations of DBC in Ruby, and once Dave
> and I get a bit more of the Ruby book finished I'll look at
> it again.
> 
> But would that be a usefull feature to have in Ruby?  
> 

Thanks for asking, Andy...  :)

Actually, I have never steeped myself in DBC. I have
tried crude implementations of it at times, but I have
never used Eiffel, where it is an integrated language
feature.

So I can only give my impression, which is: Every little
bit helps! 

In order words, even a crude implementation of DBC is,
at worst, no worse than not using it at all. In fact,
I think it would be hard to define any real pre- and 
post-conditions in your code without finding that they
were sometimes unexpectedly violated. And if you find
that they are violated, presumably you have found a 
bug.

I'm working on a DBC mechanism in Ruby. Let me crank 
a little longer and I'll make it public for everyone's 
comments and changes. And there WILL be changes. :)

Thanks,
Hal 

In This Thread

Prev Next