From: Robert Dober Date: 2006-07-24T19:29:27+09:00 Subject: Re: I'll have the duck! ------=_Part_8745_3794397.1153736962412 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 7/24/06, Alex Young wrote: > > Robert Dober wrote: > > On 7/24/06, transfire@gmail.com wrote: > > >> and hence any hash-like object. > > > > Yeah great, you see that is what troubles me, it is completely cool to > talk > > about hash-like object, but what is a hash-like object? Which messages > > must > > a hash-like object respond to? All of Hash, I suppose, thus a subclass, > or > > only some, then we can talk about protocols again, but the failure to be > > able to define the protocol just worries me. > That's the whole point. Duck-typing means that your class only needs to > define the methods (of Hash, in this case) that the called method > (transform here) needs, *not* the whole Hash class, *without* having to > specify a protocol. If you want to specify a protocol, there's one > example of how to do it here: > > http://www.erikveen.dds.nl/monitorfunctions/index.html#6.0.0 Well I have read that, kind of, it is a little bit heavy, too heavy I am afraid. I still do not get the point, are you saying I am right (let dogs life) or are you saying I am wrong (let only ducks life). Mixins are another nice way to think about it class Dog include Duck ... # no this is *not* the Perl6 Thingy Jabbawalky operator ;) end d = Puppet d.implements? Duck ==> true but maybe this is here already, gotta check. Thx for your considerations I repeat nevertheless Ducks are great, unless they kill Dogs ;) Cheers Robert > Again very important: The failure to be able, not to have to, I am 100% > for > > the enabeling approach, but who enables constraints and protocol > checking? > See above. Second time I've used that link in this thread :-) I will not blame you, yet ;) -- > Alex > ------=_Part_8745_3794397.1153736962412--