From: Robert Dober Date: 2006-04-03T00:26:37+09:00 Subject: Re: Typed Parameters ------=_Part_3786_27838066.1143991594012 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 4/2/06, gwtmp01@mac.com wrote: > > > On Apr 2, 2006, at 10:36 AM, Robert Dober wrote: > > On 4/2/06, gwtmp01@mac.com wrote: > >> On Apr 2, 2006, at 10:12 AM, Robert Dober wrote: > >>> Interesting points, please be aware though, that the runtime > >>> environement > >>> would not be burdened at all. > >> I don't follow. Wouldn't each method call involve executing the pre- > >> condition tests? > > No it would not unless specified, but look at the nice idea Austin > > has given > > us above, makes it much clearer. > > > > * precond and postcon blocks. > > > > Wouldn't that allow for great possibilities with rdoc and switching > > them > > on/off with switches. > > Just to clarify. I think there is great value in programming-by- > contract. > Being able to specify pre and post conditions (and class invariants) > in the same language as the code is great also. Unit testing is good. > A way to combine all these things in a development environment would > be great. > If this approach kept to the spirit of the Ruby syntax/style; didn't > incur any run-time costs; and was integrated into the documentation, > editing, and > testing tools it would be wonderful. > > The part that rubs me wrong is the idea that the 'production' code > needs to > also run all those pre-condition tests on each and every method call > and the It defenitely does not when we compile to byte code in Ruby2.0 :) tendency to *over* specify the pre-conditions that interfere with the > flexibility > of a dynamic language (duck typing). Over-specified runtime pre- > conditions bake in > extra assumptions that make the code more rigid than necessary (i.e. > Austin's > example of expecting '<<' but nothing more). Well can you think of any tool that cannot be abused? Gary Wright > > > -- Deux choses sont infinies : l'univers et la b=EAtise humaine ; en ce qui concerne l'univers, je n'en ai pas acquis la certitude absolue. - Albert Einstein ------=_Part_3786_27838066.1143991594012--