Bug #118
closedSortedSet#inspect does not work with nested SortedSets
Description
=begin
SortedSet["a", "b", SortedSet["c"]].inspect # => raises an ArgumentError: comparison of String with SortedSet failed
=end
Files
Updated by knu (Akinori MUSHA) over 16 years ago
=begin
SortedSet cannot be put in a SortedSet because it is not comparable (unsortable).
How do you define comparison between two (sorted) sets?
=end
Updated by Anonymous over 16 years ago
=begin
Issue #118 has been updated by Akinori MUSHA.
SortedSet cannot be put in a SortedSet because it is not comparable (unsortable).
How do you define comparison between two (sorted) sets?¶
Bug #118: SortedSet#inspect does not work with nested SortedSets
http://redmine.ruby-lang.org/issues/show/118
Author: Arthur Schreiber
Status: Open
Priority: Normal
Assigned to: Akinori MUSHA
Category:
Target version:
SortedSet["a", "b", SortedSet["c"]].inspect # => raises an ArgumentError: comparison of String with SortedSet failed
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://redmine.ruby-lang.org/my/account
=end
Updated by NoKarma (Arthur Schreiber) over 16 years ago
=begin
Here is a patch that makes SortedSet#add check that any object added to a SortedSet includes the Comparable module.
It also extends the SortedSet documentation to make it more clear how SortedSet works.
=end
Updated by Anonymous over 16 years ago
=begin
Issue #118 has been updated by Arthur Schreiber.
File set.patch added
Here is a patch that makes SortedSet#add check that any object added to a SortedSet includes the Comparable module.
It also extends the SortedSet documentation to make it more clear how SortedSet works.
Bug #118: SortedSet#inspect does not work with nested SortedSets
http://redmine.ruby-lang.org/issues/show/118
Author: Arthur Schreiber
Status: Open
Priority: Normal
Assigned to: Akinori MUSHA
Category:
Target version:
SortedSet["a", "b", SortedSet["c"]].inspect # => raises an ArgumentError: comparison of String with SortedSet failed
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://redmine.ruby-lang.org/my/account
=end
Updated by knu (Akinori MUSHA) over 16 years ago
=begin
add() is not the only method that adds new elements to a set, but merge() also is.
For merge(), you can omit the check when the given enumerable object is a SortedSet.
=end
Updated by Anonymous over 16 years ago
=begin
Issue #118 has been updated by Akinori MUSHA.
add() is not the only method that adds new elements to a set, but merge() also is.
For merge(), you can omit the check when the given enumerable object is a SortedSet.¶
Bug #118: SortedSet#inspect does not work with nested SortedSets
http://redmine.ruby-lang.org/issues/show/118
Author: Arthur Schreiber
Status: Open
Priority: Normal
Assigned to: Akinori MUSHA
Category:
Target version:
SortedSet["a", "b", SortedSet["c"]].inspect # => raises an ArgumentError: comparison of String with SortedSet failed
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://redmine.ruby-lang.org/my/account
=end
Updated by NoKarma (Arthur Schreiber) over 16 years ago
=begin
SortedSet#merge calls super (Set#merge), which in turn calls SortedSet#add for non-Set objects.
So the only check needed is on SortedSet#add.
=end
Updated by Anonymous over 16 years ago
=begin
Issue #118 has been updated by Arthur Schreiber.
SortedSet#merge calls super (Set#merge), which in turn calls SortedSet#add for non-Set objects. So the only check needed is on SortedSet#add.¶
Bug #118: SortedSet#inspect does not work with nested SortedSets
http://redmine.ruby-lang.org/issues/show/118
Author: Arthur Schreiber
Status: Open
Priority: Normal
Assigned to: Akinori MUSHA
Category:
Target version:
SortedSet["a", "b", SortedSet["c"]].inspect # => raises an ArgumentError: comparison of String with SortedSet failed
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://redmine.ruby-lang.org/my/account
=end
Updated by NoKarma (Arthur Schreiber) over 16 years ago
=begin
I attached a new patch for the set library.
I changed Set#merge to only directly use the passed objects @hash instance variable when self
and the passed object are instances of the same class.
This prevents the addition of non-Comparable Objects when calling SortedSet#merge with a Set.
I hope the patch is ok now.
=end
Updated by Anonymous over 16 years ago
=begin
Issue #118 has been updated by Arthur Schreiber.
File set.patch added
I attached a new patch for the set library.
I changed Set#merge to only directly use the passed objects @hash instance variable, when self
and the passed object are instances of the same class.
This prevents bugs when using a SortedSet in conjunction with the rbtree library.
Additionally, It prevents the merging of non-Comparable Objects when calling SortedSet#merge with a Set.
I hope the patch is ok now.¶
Bug #118: SortedSet#inspect does not work with nested SortedSets
http://redmine.ruby-lang.org/issues/show/118
Author: Arthur Schreiber
Status: Open
Priority: Normal
Assigned to: Akinori MUSHA
Category:
Target version:
SortedSet["a", "b", SortedSet["c"]].inspect # => raises an ArgumentError: comparison of String with SortedSet failed
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://redmine.ruby-lang.org/my/account
=end
Updated by knu (Akinori MUSHA) over 15 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
=begin
Applied in changeset r23322.
=end