From: Claus Spitzer Date: 2004-06-05T12:48:48+09:00 Subject: Re: How to ducktype a Hash? Well, what exactly do all your hash-like objects have in common that is not present in any other object? :keys is a pretty good identifier for a hash... since I know of no other data structure that has a key (mind you, I said "_I_ know of", there could well be one that I don't know). . On Sat, 5 Jun 2004 11:15:37 +0900, Sean O'Dell wrote: > 8< ----- snip ----- > > In both cases, does that mean that the object has hash-like functionality, or > just that the object responds to those two methods? Is there some definition > somewhere that says "it's a hash if it has these methods?" I actually have > hash-like objects that DON'T respond to either of those two methods, but it > would be easy enough to add fake ones. I hate adding fake methods just to id > a hash interface, it's a kludge. > > Sean O'Dell > >