From: Daniel Schierbeck Date: 2005-12-16T04:32:40+09:00 Subject: Re: Easy Duck-Typing dblack@wobblini.net wrote: > Hi -- > > On Fri, 16 Dec 2005, Daniel Schierbeck wrote: > >> This will make it easier to add type checking to your methods. Let me >> know if you think the method belongs in Object or another class, >> rather than in the Kernel module. > > This may be useful to you, but it isn't duck typing. In fact, it > appears to be more or less the opposite, in concept. Here, you're > checking class ancestry and gatekeeping your method calls and return > values based on that ancestry. The thrust of duck typing, as I > understand it, is that you just ask an object to do something -- > without regard to its class, and quite likely without doing a > respond_to? call first. > > > David I guess you're right, I actually realised it moments after i sent the mail. I still find it useful though, when you really *do* need an object of a specific type. "Implicit conversion" may be better :) Cheers, Daniel