https://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?15582348732008-06-09T18:10:46ZRuby Issue Tracking SystemRuby 1.8 - Bug #118: SortedSet#inspect does not work with nested SortedSetshttps://redmine.ruby-lang.org/issues/118?journal_id=942008-06-09T18:10:46Zknu (Akinori MUSHA)knu@ruby-lang.org
<ul></ul><p>=begin<br>
SortedSet cannot be put in a SortedSet because it is not comparable (unsortable).</p>
<p>How do you define comparison between two (sorted) sets?<br>
=end</p>
Ruby 1.8 - Bug #118: SortedSet#inspect does not work with nested SortedSetshttps://redmine.ruby-lang.org/issues/118?journal_id=952008-06-09T18:11:05ZAnonymous
<ul></ul><p>=begin<br>
Issue <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: SortedSet#inspect does not work with nested SortedSets (Closed)" href="https://redmine.ruby-lang.org/issues/118">#118</a> has been updated by Akinori MUSHA.</p>
<p>SortedSet cannot be put in a SortedSet because it is not comparable (unsortable).</p>
<p>How do you define comparison between two (sorted) sets?</p>
<hr>
<p>Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: SortedSet#inspect does not work with nested SortedSets (Closed)" href="https://redmine.ruby-lang.org/issues/118">#118</a>: SortedSet#inspect does not work with nested SortedSets<br>
<a href="http://redmine.ruby-lang.org/issues/show/118">http://redmine.ruby-lang.org/issues/show/118</a></p>
<p>Author: Arthur Schreiber<br>
Status: Open<br>
Priority: Normal<br>
Assigned to: Akinori MUSHA<br>
Category: <br>
Target version: </p>
<p>SortedSet[&quot;a&quot;, &quot;b&quot;, SortedSet[&quot;c&quot;]].inspect # =&gt; raises an ArgumentError: comparison of String with SortedSet failed</p>
<hr>
<p>You have received this notification because you have either subscribed to it, or are involved in it.<br>
To change your notification preferences, please click here: <a href="http://redmine.ruby-lang.org/my/account">http://redmine.ruby-lang.org/my/account</a></p>
<p>=end</p>
Ruby 1.8 - Bug #118: SortedSet#inspect does not work with nested SortedSetshttps://redmine.ruby-lang.org/issues/118?journal_id=1092008-06-10T17:43:37ZNoKarma (Arthur Schreiber)schreiber.arthur@gmail.com
<ul><li><strong>File</strong> <a href="/attachments/4">set.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/4/set.patch">set.patch</a> added</li></ul><p>=begin<br>
Here is a patch that makes SortedSet#add check that any object added to a SortedSet includes the Comparable module.<br>
It also extends the SortedSet documentation to make it more clear how SortedSet works.<br>
=end</p>
Ruby 1.8 - Bug #118: SortedSet#inspect does not work with nested SortedSetshttps://redmine.ruby-lang.org/issues/118?journal_id=1122008-06-10T17:58:24ZAnonymous
<ul></ul><p>=begin<br>
Issue <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: SortedSet#inspect does not work with nested SortedSets (Closed)" href="https://redmine.ruby-lang.org/issues/118">#118</a> has been updated by Arthur Schreiber.</p>
<p>File set.patch added</p>
<p>Here is a patch that makes SortedSet#add check that any object added to a SortedSet includes the Comparable module.<br>
It also extends the SortedSet documentation to make it more clear how SortedSet works.</p>
<hr>
<p>Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: SortedSet#inspect does not work with nested SortedSets (Closed)" href="https://redmine.ruby-lang.org/issues/118">#118</a>: SortedSet#inspect does not work with nested SortedSets<br>
<a href="http://redmine.ruby-lang.org/issues/show/118">http://redmine.ruby-lang.org/issues/show/118</a></p>
<p>Author: Arthur Schreiber<br>
Status: Open<br>
Priority: Normal<br>
Assigned to: Akinori MUSHA<br>
Category: <br>
Target version: </p>
<p>SortedSet[&quot;a&quot;, &quot;b&quot;, SortedSet[&quot;c&quot;]].inspect # =&gt; raises an ArgumentError: comparison of String with SortedSet failed</p>
<hr>
<p>You have received this notification because you have either subscribed to it, or are involved in it.<br>
To change your notification preferences, please click here: <a href="http://redmine.ruby-lang.org/my/account">http://redmine.ruby-lang.org/my/account</a></p>
<p>=end</p>
Ruby 1.8 - Bug #118: SortedSet#inspect does not work with nested SortedSetshttps://redmine.ruby-lang.org/issues/118?journal_id=1132008-06-10T18:17:01Zknu (Akinori MUSHA)knu@ruby-lang.org
<ul></ul><p>=begin<br>
add() is not the only method that adds new elements to a set, but merge() also is.</p>
<p>For merge(), you can omit the check when the given enumerable object is a SortedSet.<br>
=end</p>
Ruby 1.8 - Bug #118: SortedSet#inspect does not work with nested SortedSetshttps://redmine.ruby-lang.org/issues/118?journal_id=1142008-06-10T18:24:55ZAnonymous
<ul></ul><p>=begin<br>
Issue <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: SortedSet#inspect does not work with nested SortedSets (Closed)" href="https://redmine.ruby-lang.org/issues/118">#118</a> has been updated by Akinori MUSHA.</p>
<p>add() is not the only method that adds new elements to a set, but merge() also is.</p>
<p>For merge(), you can omit the check when the given enumerable object is a SortedSet.</p>
<hr>
<p>Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: SortedSet#inspect does not work with nested SortedSets (Closed)" href="https://redmine.ruby-lang.org/issues/118">#118</a>: SortedSet#inspect does not work with nested SortedSets<br>
<a href="http://redmine.ruby-lang.org/issues/show/118">http://redmine.ruby-lang.org/issues/show/118</a></p>
<p>Author: Arthur Schreiber<br>
Status: Open<br>
Priority: Normal<br>
Assigned to: Akinori MUSHA<br>
Category: <br>
Target version: </p>
<p>SortedSet[&quot;a&quot;, &quot;b&quot;, SortedSet[&quot;c&quot;]].inspect # =&gt; raises an ArgumentError: comparison of String with SortedSet failed</p>
<hr>
<p>You have received this notification because you have either subscribed to it, or are involved in it.<br>
To change your notification preferences, please click here: <a href="http://redmine.ruby-lang.org/my/account">http://redmine.ruby-lang.org/my/account</a></p>
<p>=end</p>
Ruby 1.8 - Bug #118: SortedSet#inspect does not work with nested SortedSetshttps://redmine.ruby-lang.org/issues/118?journal_id=1152008-06-10T18:50:19ZNoKarma (Arthur Schreiber)schreiber.arthur@gmail.com
<ul></ul><p>=begin<br>
SortedSet#merge calls super (Set#merge), which in turn calls SortedSet#add for non-Set objects.<br>
So the only check needed is on SortedSet#add.<br>
=end</p>
Ruby 1.8 - Bug #118: SortedSet#inspect does not work with nested SortedSetshttps://redmine.ruby-lang.org/issues/118?journal_id=1162008-06-10T18:58:07ZAnonymous
<ul></ul><p>=begin<br>
Issue <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: SortedSet#inspect does not work with nested SortedSets (Closed)" href="https://redmine.ruby-lang.org/issues/118">#118</a> has been updated by Arthur Schreiber.</p>
<p>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.</p>
<hr>
<p>Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: SortedSet#inspect does not work with nested SortedSets (Closed)" href="https://redmine.ruby-lang.org/issues/118">#118</a>: SortedSet#inspect does not work with nested SortedSets<br>
<a href="http://redmine.ruby-lang.org/issues/show/118">http://redmine.ruby-lang.org/issues/show/118</a></p>
<p>Author: Arthur Schreiber<br>
Status: Open<br>
Priority: Normal<br>
Assigned to: Akinori MUSHA<br>
Category: <br>
Target version: </p>
<p>SortedSet[&quot;a&quot;, &quot;b&quot;, SortedSet[&quot;c&quot;]].inspect # =&gt; raises an ArgumentError: comparison of String with SortedSet failed</p>
<hr>
<p>You have received this notification because you have either subscribed to it, or are involved in it.<br>
To change your notification preferences, please click here: <a href="http://redmine.ruby-lang.org/my/account">http://redmine.ruby-lang.org/my/account</a></p>
<p>=end</p>
Ruby 1.8 - Bug #118: SortedSet#inspect does not work with nested SortedSetshttps://redmine.ruby-lang.org/issues/118?journal_id=1172008-06-10T21:56:07ZNoKarma (Arthur Schreiber)schreiber.arthur@gmail.com
<ul><li><strong>File</strong> <a href="/attachments/5">set.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/5/set.patch">set.patch</a> added</li></ul><p>=begin<br>
I attached a new patch for the set library.</p>
<p>I changed Set#merge to only directly use the passed objects @hash instance variable when self<br>
and the passed object are instances of the same class.</p>
<p>This prevents the addition of non-Comparable Objects when calling SortedSet#merge with a Set.</p>
<p>I hope the patch is ok now.<br>
=end</p>
Ruby 1.8 - Bug #118: SortedSet#inspect does not work with nested SortedSetshttps://redmine.ruby-lang.org/issues/118?journal_id=1182008-06-10T22:04:00ZAnonymous
<ul></ul><p>=begin<br>
Issue <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: SortedSet#inspect does not work with nested SortedSets (Closed)" href="https://redmine.ruby-lang.org/issues/118">#118</a> has been updated by Arthur Schreiber.</p>
<p>File set.patch added</p>
<p>I attached a new patch for the set library.</p>
<p>I changed Set#merge to only directly use the passed objects @hash instance variable, when self<br>
and the passed object are instances of the same class.</p>
<p>This prevents bugs when using a SortedSet in conjunction with the rbtree library.<br>
Additionally, It prevents the merging of non-Comparable Objects when calling SortedSet#merge with a Set.</p>
<p>I hope the patch is ok now.</p>
<hr>
<p>Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: SortedSet#inspect does not work with nested SortedSets (Closed)" href="https://redmine.ruby-lang.org/issues/118">#118</a>: SortedSet#inspect does not work with nested SortedSets<br>
<a href="http://redmine.ruby-lang.org/issues/show/118">http://redmine.ruby-lang.org/issues/show/118</a></p>
<p>Author: Arthur Schreiber<br>
Status: Open<br>
Priority: Normal<br>
Assigned to: Akinori MUSHA<br>
Category: <br>
Target version: </p>
<p>SortedSet[&quot;a&quot;, &quot;b&quot;, SortedSet[&quot;c&quot;]].inspect # =&gt; raises an ArgumentError: comparison of String with SortedSet failed</p>
<hr>
<p>You have received this notification because you have either subscribed to it, or are involved in it.<br>
To change your notification preferences, please click here: <a href="http://redmine.ruby-lang.org/my/account">http://redmine.ruby-lang.org/my/account</a></p>
<p>=end</p>
Ruby 1.8 - Bug #118: SortedSet#inspect does not work with nested SortedSetshttps://redmine.ruby-lang.org/issues/118?journal_id=38652009-05-01T16:57:07Zknu (Akinori MUSHA)knu@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>=begin<br>
Applied in changeset <a class="changeset" title="* lib/set.rb (SortedSet#add): Do not let an uncomparable object in. [Bug #118] * lib/set.rb (S..." href="https://redmine.ruby-lang.org/projects/ruby-18/repository/25/revisions/23322">r23322</a>.<br>
=end</p>