From: "Florian Aßmann" Date: 2008-12-01T16:18:17+09:00 Subject: Re: Enumerable#select used to return actual values What about Enumerable.into(something) ... Regards Florian Am 01.12.2008 um 04:39 schrieb Mike Austin: > Robert Dober wrote: >> On Mon, Dec 1, 2008 at 12:24 AM, Yukihiro Matsumoto > > wrote: >>> #each_with_object is an interesting concept. Maybe we can add it to >>> the Enumerable if we can come up with a better name. >>> >>> matz. >> Maybe the difficulty to find a name points to a problem... >> I was just thinking that this looks really cool >> [].with_each( 1..10 ){ |o, e| o << e if e > 5 } > > What about just "each_with()"? > > (1..10).each_with([]) { |o, e| o << e if e > 5 } > > It goes together well with "each_with_index()", imho. > >> What do you think, surely adding #with_each to #Object shall be very >> carefully considered, but I like the syntax, err yes I have already >> said that ;) >> Robert > > Mike >