https://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17113305112008-06-09T18:09:15ZRuby Issue Tracking SystemRuby 1.8 - Bug #117: SortedSet#flatten_merge and SortedSet#flatten can't actually flatten nested SortedSetshttps://redmine.ruby-lang.org/issues/117?journal_id=922008-06-09T18:09:15Zknu (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>Do you suggest that it should emit an error on every new/add/merge?<br>
I wonder if it's worth the cost..<br>
=end</p> Ruby 1.8 - Bug #117: SortedSet#flatten_merge and SortedSet#flatten can't actually flatten nested SortedSetshttps://redmine.ruby-lang.org/issues/117?journal_id=932008-06-09T18:09:29ZAnonymous
<ul></ul><p>=begin<br>
Issue <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: SortedSet#flatten_merge and SortedSet#flatten can't actually flatten nested SortedSets (Closed)" href="https://redmine.ruby-lang.org/issues/117">#117</a> has been updated by Akinori MUSHA.</p>
<p>SortedSet cannot be put in a SortedSet because it is not comparable (unsortable).</p>
<h2>Do you suggest that it should emit an error on every new/add/merge?<br>
I wonder if it's worth the cost..</h2>
<p>Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: SortedSet#flatten_merge and SortedSet#flatten can't actually flatten nested SortedSets (Closed)" href="https://redmine.ruby-lang.org/issues/117">#117</a>: SortedSet#flatten_merge and SortedSet#flatten can't actually flatten nested SortedSets<br>
<a href="http://redmine.ruby-lang.org/issues/show/117" class="external">http://redmine.ruby-lang.org/issues/show/117</a></p>
<p>Author: Arthur Schreiber<br>
Status: Open<br>
Priority: Normal<br>
Assigned to: Akinori MUSHA<br>
Category:<br>
Target version:</p>
<p>set1 = SortedSet[1, 2]<br>
set2 = SortedSet[3, 4, SortedSet[5, 6]]<br>
set1.send(:flatten_merge, set2) # => raises a NoMethodError: undefined method `<=>' for #<SortedSet: {5, 6}></p>
<p>SortedSet[1, 2, SortedSet[3, 4, SortedSet[5, 6, SortedSet[7, 8]]], 9, 10].flatten # => raises a NoMethodError: undefined method `<=>' for #<a href="SortedSet:0x5f2be8" class="external">SortedSet:0x5f2be8</a></p>
<p>SortedSet[1, 2, SortedSet[3, 4]].flatten # => raises an ArgumentError: comparison of Fixnum 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" class="external">http://redmine.ruby-lang.org/my/account</a></p>
<p>=end</p> Ruby 1.8 - Bug #117: SortedSet#flatten_merge and SortedSet#flatten can't actually flatten nested SortedSetshttps://redmine.ruby-lang.org/issues/117?journal_id=1232008-06-11T04:02:35ZNoKarma (Arthur Schreiber)schreiber.arthur@gmail.com
<ul></ul><p>=begin<br>
I think that the best solution to this problem would be to undefine #flatten, #flatten! and #flatten_merge from SortedSet.<br>
Their existance only confuses by suggesting that you can put Sets or SortedSets inside a SortedSet.<br>
Also, there is no case I can think of where you could actually call flatten on a SortedSet.<br>
=end</p> Ruby 1.8 - Bug #117: SortedSet#flatten_merge and SortedSet#flatten can't actually flatten nested SortedSetshttps://redmine.ruby-lang.org/issues/117?journal_id=1242008-06-11T04:10:23ZAnonymous
<ul></ul><p>=begin<br>
Issue <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: SortedSet#flatten_merge and SortedSet#flatten can't actually flatten nested SortedSets (Closed)" href="https://redmine.ruby-lang.org/issues/117">#117</a> has been updated by Arthur Schreiber.</p>
<h2>I think that the best solution to this problem would be to undefine #flatten, #flatten! and #flatten_merge from SortedSet.<br>
Their existance only confuses by suggesting that you can put Sets or SortedSets inside a Set.<br>
Also, there is no case I can think of where you could actually call flatten on a SortedSet.</h2>
<p>Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: SortedSet#flatten_merge and SortedSet#flatten can't actually flatten nested SortedSets (Closed)" href="https://redmine.ruby-lang.org/issues/117">#117</a>: SortedSet#flatten_merge and SortedSet#flatten can't actually flatten nested SortedSets<br>
<a href="http://redmine.ruby-lang.org/issues/show/117" class="external">http://redmine.ruby-lang.org/issues/show/117</a></p>
<p>Author: Arthur Schreiber<br>
Status: Open<br>
Priority: Normal<br>
Assigned to: Akinori MUSHA<br>
Category:<br>
Target version:</p>
<p>set1 = SortedSet[1, 2]<br>
set2 = SortedSet[3, 4, SortedSet[5, 6]]<br>
set1.send(:flatten_merge, set2) # => raises a NoMethodError: undefined method `<=>' for #<SortedSet: {5, 6}></p>
<p>SortedSet[1, 2, SortedSet[3, 4, SortedSet[5, 6, SortedSet[7, 8]]], 9, 10].flatten # => raises a NoMethodError: undefined method `<=>' for #<a href="SortedSet:0x5f2be8" class="external">SortedSet:0x5f2be8</a></p>
<p>SortedSet[1, 2, SortedSet[3, 4]].flatten # => raises an ArgumentError: comparison of Fixnum 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" class="external">http://redmine.ruby-lang.org/my/account</a></p>
<p>=end</p> Ruby 1.8 - Bug #117: SortedSet#flatten_merge and SortedSet#flatten can't actually flatten nested SortedSetshttps://redmine.ruby-lang.org/issues/117?journal_id=38702009-05-03T02:34:37Zujihisa (Tatsuhiro Ujihisa)
<ul></ul><p>=begin<br>
By the commit <a href="http://redmine.ruby-lang.org/repositories/diff/ruby-18?rev=23322" class="external">http://redmine.ruby-lang.org/repositories/diff/ruby-18?rev=23322</a>, I suggest this bug is automatically solved.<br>
=end</p> Ruby 1.8 - Bug #117: SortedSet#flatten_merge and SortedSet#flatten can't actually flatten nested SortedSetshttps://redmine.ruby-lang.org/issues/117?journal_id=38722009-05-04T14:29:59Zknu (Akinori MUSHA)knu@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li></ul><p>=begin<br>
r23322 fixes this also.<br>
=end</p>