From: Harry Ohlsen Date: 2002-08-04T07:19:39+09:00 Subject: Re: Assoc Class (Hash Pairs) On Sun, 4 Aug 2002 04:05, you wrote: > i've been thinking about posting this as an RCR. > > i would really like to see hash pairs (associations) become real > objects. i think it would be a very powerful and useful construct. there > are number of things one could then do. The simpliest obviosuly being: > > x = 'a'=>1 > y = 'b'=>2 > > hash = { x, y } > > ordered hashes also become a snap, implemented as arrays of these > associations: > > ordhash = [ x, y ] > > or, without the above x and y assignments, just > > ordhash = [ 'a'=>1 , 'b'=>2 ] > > this association class (Assoc?) would of course mixin the comparable > module. This piques my interest, but I'm at a loss to see what one would DO with one of these. Ie, you obviously see that some types of problems would be made easier/cleaner by the use of this kind of data structure. Can you give an example where having these would be helpful?