Robert Dober wrote: > On 7/24/06, transfire / gmail.com <transfire / gmail.com> wrote: <snip> >> 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 > 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 :-) -- Alex