From: Adam Prescott Date: 2011-03-05T03:31:37+09:00 Subject: Re: Semantics of 1.9.2 Set --e0cb4e43cf1193de44049dac5704 Content-Type: text/plain; charset=UTF-8 On Fri, Mar 4, 2011 at 6:22 PM, Colin Bartlett wrote: > On Tue, Mar 1, 2011 at 4:45 PM, John wrote: > > I'm looking at the doc for the 1.9.2 Set class, which says > > (http://www.ruby-doc.org/stdlib/libdoc/set/rdoc/classes/Set.html): > > > > Since the doc explicitly defines Hash as the underlying store, and > > since Hash in 1.9.2 observes insertion order (http://ruby-doc.org/core/ > > classes/Hash.html) during enumeration, I wonder if the doc for Set > > should be changed? > > But given the actual documentation of Set, it would be unwise to do > this: a later implementation of Set might use something other than an > insertion order preserving Hash. > > In short, I think the documentation for Set should remain as it is. Or > possibly say explicitly that whilst the current implementation of Set > uses Hash for storage, it should not be assumed that this will always > be the case. > > I would agree that the documentation should not mention any order, as that's not what defines a Set, it's just a leftover from an implementation with Hashes. I don't think it should be stressed that its current implementation is a Hash, in the documentation, though. If it's included, it definitely should be pointed out that the implementation with a Hash is not a normative restriction. I was hoping someone who had a detailed knowledge of Set and Hash > would give you an answer. Since I don't qualify on the detailed > knowledge grounds, I'll try my knowledge of logic, and hope that fits. I think you responded quite well, for what it's worth. :) --e0cb4e43cf1193de44049dac5704--