From: "Földes László" Date: 2012-05-08T06:24:42+09:00 Subject: Re: Why Enumerator#next does not return more than one value? Robert Klemme wrote in post #1059863: > On Mon, May 7, 2012 at 3:10 PM, Fldes Lszl wrote: >> >> Is there a nicer way to do it? (Or did I overlook some existing method >> in Enumerable?) > > Question is: what do you need that for? I'm trying to find some pattern in a certain series (a logistic map). The series is infinite. I want to get - say- 10 values from the Enumerator, examine it, and either return something ("found") and/or continue searching. (I know this won't find overlaps, it's just an experiment). Both #each_slice and #each_cons try to build an Array from the enumerator, which is - in this case - impossible, because the Enumerator is infinite and would eat up all the memory. I read about lazy_select and chained filters for enum which might be a solution but I have yet to understand them. For the time being I'm sticking to that #map solution. Thanks -- Posted via http://www.ruby-forum.com/.