From: Eero Saynatkari Date: 2010-03-04T06:10:29+09:00 Subject: [ruby-core:28451] Re: [Bug #1893] Recursive Enumerable#join is surprising On Mar 3, 2010, at 9:46 AM, Jeremy Kemper wrote: > This is a similar situation with to_s/to_str and the proposed to_r/ to_rat, to_f/to_flo. I think these confusions could be resolved with as_str and as_rat. I do not think adding yet another method solves anything; on the contrary. In any case, the usages clearly need to be defined better, and implementation should be changed to correspond to the definition. Possible definition using Array as example: #to_a: - Returns an Array. - Could be a *representation* of the object as an Array, but I do not think this needs to be specified. Just some Array. - The Array may be independent of the original object. (I would be tempted to specify that it *is*, i.e. that Array#to_a would actually #dup the original, but this may not be desirable.) #to_ary - Returns an Array-like object (either all methods or some defined subset like #[], #[]= and #size only.) - The returned object is tied to the original. Changes made to it should reflect in the original. Is this missing a use case (and is such a use case valid)? Eero -- Magic is insufficiently advanced technology.