From: Yukihiro Matsumoto Date: 2010-03-12T18:36:27+09:00 Subject: [ruby-core:28626] Re: [Bug #1893] Recursive Enumerable#join is surprising Hi, In message "Re: [ruby-core:28625] Re: [Bug #1893] Recursive Enumerable#join is surprising" on Fri, 12 Mar 2010 18:17:16 +0900, Yusuke ENDOH writes: |When you say two objects are "almost equivalent", do you expect duck |typing? If they behave the same enough, we can directly call #each, |#[], #[]=, etc. without calling #to_ary. |Is #to_ary just for performance? If so, I think we should handle an |array-like object as an array even if it doesn't provide #to_ary. The whole purpose of to_ary, to_str etc, is to support implicit type conversion for Array/String-like objects into real Array/String for C defined functions which requires legit typing. By String/Array-like object, I mean Delegators, for example. So in a sense, it's for performance, by allowing C functions to bypass method invocation. matz.