From: Robert Dober Date: 2006-08-15T01:46:48+09:00 Subject: Re: A use case for an ordered hash ------=_Part_70788_2589871.1155574000728 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 8/14/06, Austin Ziegler wrote: > > On 8/14/06, Martin DeMello wrote: > > OHash or Assoc or even Dict (though the latter at least implies an O(1) > lookup). > > Wouldn't it be the same as Hash lookup? It's still got every other > characteristic of a Hash; it just guarantees an order that defaults to > insertion order. That too is a point that needs definition. I'd like to have two behaviors. I call the first one static, and the second one dynamic (and I describe the second one first of course). Than I would like to be able to write, I do not need literals, but that is another story that shall be told another day. dyn =3D D.new( :a =3D> 42, :b =3D> 42, :c =3D> 42 ) #using future named par= ams of course dyn[:b] =3D 42 puts dyn.keys.join("*") =3D > "a*c*b" while the static bersion would of course result in =3D> "a*b*c" Even the static version has no memory of course and static[k]=3Dstatic.delete(k) would become a very meaningful statement, suddenly :) Cheers Robert BTW Do you think one(*42) can generalize Hash values to 42? I think that would be a nice Set(up). R. > -austin > -- > Austin Ziegler * halostatue@gmail.com * http://www.halostatue.ca/ > * austin@halostatue.ca * http://www.halostatue.ca/feed/ > * austin@zieglers.ca > > --=20 Deux choses sont infinies : l'univers et la b=EAtise humaine ; en ce qui concerne l'univers, je n'en ai pas acquis la certitude absolue. - Albert Einstein ------=_Part_70788_2589871.1155574000728--