From: Robert Klemme Date: 2004-06-08T00:58:44+09:00 Subject: Re: How to ducktype a Hash? "Gavin Sinclair" schrieb im Newsbeitrag news:152037064864.20040608014941@soyabean.com.au... > On Tuesday, June 8, 2004, 1:39:10 AM, Robert wrote: > > > > "Gavin Sinclair" schrieb im Newsbeitrag > > news:1482033218333.20040608004534@soyabean.com.au... > >> On Monday, June 7, 2004, 11:27:41 PM, David wrote: > >> > >> > I think what we may be running into is the possibility that > >> > "ducktyping a Hash" is in a sense a contradiction in terms. > >> > >> Let me just say that Sean, despite his protestations, doesn't really > >> want to check that something is "hash-like". He wants to check that > >> something is "map-like". Forget fetch, store, [], etc. A map has two > >> essential properties: "keys" and "values". OK, we can all go home now > >> :) > > > Well, you can even view an Array as map like: keys are integers and values > > whatever you like. > > Yeah, but that's a crappy kind of map :) It depends on how much abstraction you throw in. :-) RAM can be viewed as this kind of mapping, too... > That's more like an array :\ How did you know? You didn't to #kind_of? Array, did you? :-) robert