From: shyouhei@... Date: 2016-03-28T03:34:03+00:00 Subject: [ruby-core:74613] [Ruby trunk Misc#12210][Assigned] Add IdentitySet class that compares members by identity Issue #12210 has been updated by Shyouhei Urabe. Status changed from Open to Assigned Assignee set to Akinori MUSHA ---------------------------------------- Misc #12210: Add IdentitySet class that compares members by identity https://bugs.ruby-lang.org/issues/12210#change-57741 * Author: Tim Perkins * Status: Assigned * Priority: Normal * Assignee: Akinori MUSHA ---------------------------------------- This subclass of Set handles a use case that we ran into where we needed to track instances of objects that might compare as equal. I was surprised that there was not a core way to do this. IdentitySet allows you to do the following (trivial example using strings): ~~~ruby a_str = "a" s = IdentitySet.new([a_str, a_str, "b", "b"]) p s # => # ~~~ ---Files-------------------------------- identity_set.diff (1.18 KB) -- https://bugs.ruby-lang.org/ Unsubscribe: