Forum: Ruby-core [ruby-trunk - Feature #6589][Open] Set#rehash

Posted by marcandre (Marc-Andre Lafortune) (Guest)
on 2012-06-14 04:55
(Received via mailing list)
Issue #6589 has been reported by marcandre (Marc-Andre Lafortune).

----------------------------------------
Feature #6589: Set#rehash
https://bugs.ruby-lang.org/issues/6589

Author: marcandre (Marc-Andre Lafortune)
Status: Open
Priority: Normal
Assignee: knu (Akinori MUSHA)
Category: lib
Target version: 2.0.0


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-thi...
http://stackoverflow.com/questions/10361400/deleti...
Posted by mame (Yusuke Endoh) (Guest)
on 2012-07-14 11:38
(Received via mailing list)
Issue #6589 has been updated by mame (Yusuke Endoh).

Status changed from Open to Assigned


----------------------------------------
Feature #6589: Set#rehash
https://bugs.ruby-lang.org/issues/6589#change-28086

Author: marcandre (Marc-Andre Lafortune)
Status: Assigned
Priority: Normal
Assignee: knu (Akinori MUSHA)
Category: lib
Target version: 2.0.0


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-thi...
http://stackoverflow.com/questions/10361400/deleti...
Posted by yhara (Yutaka HARA) (Guest)
on 2012-10-25 12:45
(Received via mailing list)
Issue #6589 has been updated by yhara (Yutaka HARA).

Target version changed from 2.0.0 to next minor


----------------------------------------
Feature #6589: Set#rehash
https://bugs.ruby-lang.org/issues/6589#change-31536

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-thi...
http://stackoverflow.com/questions/10361400/deleti...
Posted by marcandre (Marc-Andre Lafortune) (Guest)
on 2012-11-12 05:12
(Received via mailing list)
Issue #6589 has been updated by marcandre (Marc-Andre Lafortune).


Comment about this trivial but needed feature would be appreciated.

----------------------------------------
Feature #6589: Set#rehash
https://bugs.ruby-lang.org/issues/6589#change-32799

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-thi...
http://stackoverflow.com/questions/10361400/deleti...
Posted by Charles Nutter (headius)
on 2012-11-24 18:06
(Received via mailing list)
Issue #6589 has been updated by headius (Charles Nutter).


Is it specified that Set must be hashtable-based forever? There are 
alternate ways to implement a Set.
----------------------------------------
Feature #6589: Set#rehash
https://bugs.ruby-lang.org/issues/6589#change-33820

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-thi...
http://stackoverflow.com/questions/10361400/deleti...
Posted by marcandre (Marc-Andre Lafortune) (Guest)
on 2012-11-25 03:17
(Received via mailing list)
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-thi...
http://stackoverflow.com/questions/10361400/deleti...
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.