From: Mike Wyer Date: 2003-04-25T19:33:38+09:00 Subject: Re: Design By Contract. On Fri, 25 Apr 2003, Robert Klemme wrote: > > "Ken Hilton" schrieb im Newsbeitrag > news:xbUpa.606467$L1.172152@sccrnsc02... > > Several months ago, I made a posting regarding a possible enhancement to > > Ruby to facilitate Design by Contract (DbC). Matz and Justin were kind > > enough to reply w/their thoughts and I was curious to know whether there > is > > any hope for such functionality in any near future release of Ruby. > > Since ruby is dynamically typed currently I don't see much chance to have > DBC in ruby. You can't even fix argument types of methods in the > interface. You can of course do argument (type) checking at runtime, but > there's not static type information about arguments. I always saw DBC as the combination of pre-, post-, and loop variable- conditions. There's nothing to mandate static, compile time checking, and the flavour of DBC I'm used to is very much geared towards runtime checks. There's no point evaluating a pre-condition unless you've been given something to evaluate, which yells "runtime!" to me, but maybe I've just been using dynamic languages for too long :) Cheers, Mike -- Mike Wyer www.wyer.org/mike 07974 254007 "I want to die peacefully in my sleep like my Grandfather... ... not screaming and yelling like the passengers in his car"