Project

General

Profile

Actions

Bug #1741

closed

Enumerable#join with Nested Enumerables

Added by runpaint (Run Paint Run Run) almost 15 years ago. Updated about 13 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.2dev (2009-07-08 trunk 23987) [i686-linux]
Backport:
[ruby-core:24196]

Description

=begin
Enumerable#join acts oddly for nested Enumerables. Should the output not be the same for both Array and E?

 $ cat /tmp/join.rb
 class E
   include Enumerable
   def initialize(*args)
     @e = args
   end
   def each
     @e.each {|e| yield e}
   end
 end
 p [1,[2,[3,4]]].join(':')
 p E.new(1, E.new(2, E.new(3, 4))).join(':')

 $ ruby -vw /tmp/join.rb 
 ruby 1.9.2dev (2009-07-08 trunk 23987) [i686-linux]
 "1:2:3:4"
 "1:#<E:0x957f298>"

=end

Actions #1

Updated by nobu (Nobuyoshi Nakada) almost 15 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
Applied in changeset r24017.
=end

Actions

Also available in: Atom PDF

Like0
Like0