Forum: Ruby-core [ruby-trunk - Feature #7068][Open] ability to deactivate Hash#compare_by_identity()

Posted by Suraj Kurapati (sunaku)
on 2012-09-25 20:51
(Received via mailing list)
Issue #7068 has been reported by sunaku (Suraj Kurapati).

----------------------------------------
Feature #7068: ability to deactivate Hash#compare_by_identity()
https://bugs.ruby-lang.org/issues/7068

Author: sunaku (Suraj Kurapati)
Status: Open
Priority: Normal
Assignee:
Category:
Target version:


Hello,

I am using ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux].

There is no way to deactivate a Hash's compare by identity behavior:

  h = Hash.new
  h.compare_by_identity
  h.compare_by_identity? #=> true
  h.compare_by_identity
  h.compare_by_identity? #=> still true

I want the ability to deactivate that behavior afterwards, like this:

  h.compare_by_identity = false

Thanks for your consideration.
Posted by drbrain (Eric Hodel) (Guest)
on 2012-10-13 03:04
(Received via mailing list)
Issue #7068 has been updated by drbrain (Eric Hodel).

Status changed from Open to Feedback

=begin

  h = {}
  h.compare_by_identity = true
  h['a'] = 1
  h['a'] = 2
  h.compare_by_identity = false

What value is returned for (({h['a']}))?
=end

----------------------------------------
Feature #7068: ability to deactivate Hash#compare_by_identity()
https://bugs.ruby-lang.org/issues/7068#change-30501

Author: sunaku (Suraj Kurapati)
Status: Feedback
Priority: Normal
Assignee:
Category:
Target version:


Hello,

I am using ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux].

There is no way to deactivate a Hash's compare by identity behavior:

  h = Hash.new
  h.compare_by_identity
  h.compare_by_identity? #=> true
  h.compare_by_identity
  h.compare_by_identity? #=> still true

I want the ability to deactivate that behavior afterwards, like this:

  h.compare_by_identity = false

Thanks for your consideration.
Posted by mame (Yusuke Endoh) (Guest)
on 2012-11-24 00:48
(Received via mailing list)
Issue #7068 has been updated by mame (Yusuke Endoh).

Assignee set to matz (Yukihiro Matsumoto)
Priority changed from Normal to Low
Target version set to next minor

Please make the proposal complete: your use case and the corner case 
behavior (Eric said).

--
Yusuke Endoh <mame@tsg.ne.jp>
----------------------------------------
Feature #7068: ability to deactivate Hash#compare_by_identity()
https://bugs.ruby-lang.org/issues/7068#change-33675

Author: sunaku (Suraj Kurapati)
Status: Feedback
Priority: Low
Assignee: matz (Yukihiro Matsumoto)
Category:
Target version: next minor


Hello,

I am using ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux].

There is no way to deactivate a Hash's compare by identity behavior:

  h = Hash.new
  h.compare_by_identity
  h.compare_by_identity? #=> true
  h.compare_by_identity
  h.compare_by_identity? #=> still true

I want the ability to deactivate that behavior afterwards, like this:

  h.compare_by_identity = false

Thanks for your consideration.
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.