From: Austin Ziegler Date: 2006-04-02T08:17:09+09:00 Subject: Re: Typed Parameters 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 havesuggested. I personally hope it doesn't happen, as it will makeRuby 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 yourcode 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 insteadof pretending that a class indicator is sufficient for that. -austin--Austin Ziegler * halostatue@gmail.com * Alternate: austin@halostatue.ca