From: Intransition Date: 2010-04-13T01:01:44+09:00 Subject: Re: Is it possible, a fully general Enumerable#recursive ? On Apr 12, 11:08 am, Robert Klemme wrote: > I don't really understand why this thread seems to be so complicated. > I suspect that either I am missing something or not understanding > properly, or other contributors to this thread are missing something. > :-) I think I see what the confusion is. Your version of recursive looses all the nested structure of the original. And so works fine for most cases, as long that is what one wants/expects. I've been trying to do it such that the nested structure stays intact. e.g. [3,2,1,[6,5,4,[9,8,7]].recursive.sort #=> [1,2,3,[4,5,6,[7,8,9]] Your method produces: [3,2,1,[6,5,4,[9,8,7]].recursive.sort #=> [1,2,3,4,5,6,7,8,9] The former proves much more difficult.