From: David Alan Black Date: 2002-08-04T22:38:12+09:00 Subject: Re: Assoc Class (Hash Pairs) Hi -- On Sun, 4 Aug 2002, Tom Sawyer wrote: > On Sun, 2002-08-04 at 06:40, David Alan Black wrote: > > > I don't think what you're describing, if I'm understanding it, is a > > superset of regular hashes. But in any case -- why would you want > > something to displace hashes? The usefulness of hashes is pretty well > > established. You can always *add* functionality to Ruby -- it's not a > > zero-sum game :-) > > thanks david, that was very helpful. i had forgotten that hashes could > be designated with commas, although i find that notation lacking some > clarity. and the hash default helps too. so i can basically do what i > need with out extraneous code hanging about. awesome. > > on the other hand i have this odd inclination toward everything being an > object in an OOPL. even hash pairs. call me crazy! :-) It's an interesting thing to think about, in part because it raises the question of what "everything" is. For example, an array is an ordered list of elements, where each element can be of any type. So -- should there be an ArrayElement type? I tend to think of "hash pair" as sort of like "array element" -- I don't mean I think of them as the same construct, but rather that, in both cases, I take the object-hood of the underlying elements to be sufficient (in terms of "everything is an object"), together with the object-hood of the containers themselves. David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav