From: Yukihiro Matsumoto Date: 2010-03-12T13:26:27+09:00 Subject: [ruby-core:28623] Re: [Bug #1893] Recursive Enumerable#join is surprising Hi, In message "Re: [ruby-core:28622] Re: [Bug #1893] Recursive Enumerable#join is surprising" on Fri, 12 Mar 2010 12:25:00 +0900, Yusuke ENDOH writes: |2010/3/12 Yukihiro Matsumoto : |> We should do something: |> |> (a) revert and remove Enumerable#join altogether, leaving Array#join. |> (b) make Enumerable#join not to join recursively; I think Array#join |> should remain recursive join for array elements. | | |Thank you for remembering the issue! |But I like: (c) revert it and leave Enumerable#join. I am not sure what you mean by (c). By the way, I should have mentioned that Array#join will not call #to_a (but #to_ary) either we choose (a) or (b). |If Enumerator is similar to Array, (c-1) Enumerator#to_ary |should be defined. |Otherwise, (c-2) merely Array#join should not call to_a to |flatten Enumerator. | |I still prefer (c-1), though you rejected it once. Implicit conversion methods such as #to_ary and #to_str should be defined only when the object provides (almost) equivalent behavior (i.e. method set). Enumerable and Array are not the case. matz.