From: Robert Dober Date: 2006-04-02T16:01:36+09:00 Subject: Re: Typed Parameters ------=_Part_1250_21390583.1143961293071 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 4/2/06, Austin Ziegler wrote: > > On 4/1/06, Robert Dober wrote: > > Dear group > > > > there was a recent thread about "Boolean" and it braught me to my > > favorit thing I would love to have in Ruby2. > > > > *typed parameters* > > This might happen, but it's unlikely to work the way you have > suggested. I personally hope it doesn't happen, as it will make > Ruby a little less "smart." > > > My code is completely filled with things like this: > > > > def never_saw_a_better_method( clever, smart, stupid ) > > assert_type clever, String > > assert_type smart, Hash > > assert_type stuoid, Boolean > > .... > > def cool( clever : String, smart : Hash, stupid : Boolean ) > > > > and of course > > def x(y) would be equivalent to def(x : Object ) > > > > There is no other than practical reason to that, I found that this > > kind of type assertion finds the most devious bugs in my code. > > It's not actually that practical, and such things end up making your > code very much like C++ and Java. > > Ruby is smarter than that. Ruby can do more than that. > > Think in terms of what your object's required capabilities are instead > of pretending that a class indicator is sufficient for that. > > -austin > -- > Austin Ziegler * halostatue@gmail.com > * Alternate: austin@halostatue.ca > Austin as I have the highes admiration to your contribution to the community, these are claims without any evidence. Would you care to provide some? I'd really appreciate. Robert -- 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_1250_21390583.1143961293071--