From: Yusuke ENDOH Date: 2010-03-03T22:28:10+09:00 Subject: [ruby-core:28443] Re: [Bug #1893] Recursive Enumerable#join is surprising Hi, 2010/3/3 Benoit Daloze : >> | I guess adding Enumerator#to_ary is a right solution. >> >> I don't think so, supplying to_ary means that object can be considered >> as an array, which is not always the case. > > Well, I thought that long conversion methods, were supplied to behave like > what they can be converted. The problem is whether we can consider Enumerator as an array or not. I think we can in most situations, but matz has said we cannot always. I don't want to distinguish Array and Enumerator so strongly because I consider both as just a kind of collection. But I admit that the current Ruby design does not encourage such an idea (e.g., missing Enumerator#to_ary). >> Then, Array#join should not flatten Enumerator, I think. > Well, that can be useful on 2+ dimensions Array ( [[1],[2,3]].join => "123", > but it already worked like that for 1.8. ) I didn't mean Array#join should not flatten Array. It should do, of course. -- Yusuke ENDOH