From: "David A. Black" Date: 2005-05-22T20:19:21+09:00 Subject: Re: join not in Enumerable Hi -- On Sun, 22 May 2005, Kristof Bastiaensen wrote: > On Sun, 22 May 2005 11:05:10 +0900, David A. Black wrote: > >>> Why is join, and perhaps even pack in Array and not in Enumerable? >> >> I guess to_a makes the conversion pretty easy, and Array tends to >> serve as the "normalized" version of Enumerable in a lot of contexts. >> I don't know if there's any other reason. > > I believe because join requires an ordered collection, and enumerables > aren't guaranteed to be ordered. For example the order of traversing a > Hash may differ for a different hash with the same elements. For this > reason the output of join for an enumerable is undefined. I don't think the unorderedness would matter; consider, for example, Hash#to_s. David -- David A. Black dblack@wobblini.net