From: "marcandre (Marc-Andre Lafortune)" Date: 2012-11-25T11:17:37+09:00 Subject: [ruby-core:50060] [ruby-trunk - Feature #6589] Set#rehash Issue #6589 has been updated by marcandre (Marc-Andre Lafortune). headius (Charles Nutter) wrote: > Is it specified that Set must be hashtable-based forever? There are alternate ways to implement a Set. Alternate ways of implementing Set with check/insertion in O(1) that would also work if structures change without a `rehash` functionality? In any case, the documentation states that "Set uses Hash as storage", but more importantly that "The equality of each couple of elements is determined according to # Object#eql? and Object#hash". ---------------------------------------- Feature #6589: Set#rehash https://bugs.ruby-lang.org/issues/6589#change-33839 Author: marcandre (Marc-Andre Lafortune) Status: Assigned Priority: Normal Assignee: knu (Akinori MUSHA) Category: lib Target version: next minor There should be a way to rehash a `Set`. s = Set.new([[]]) s.first << 1 # s.rehash # Does not exist! s.include? [1] # => false, want true See also: http://stackoverflow.com/questions/10992423/is-this-expected-behaviour-for-a-set-of-arrays-in-ruby http://stackoverflow.com/questions/10361400/deleting-a-modified-object-from-a-set-in-a-no-op -- http://bugs.ruby-lang.org/