From: Robert Date: 2003-05-31T18:56:36+09:00 Subject: Re: Iteration - last detection "Brian Candler" schrieb im Newsbeitrag news:20030530153346.GA8693@uk.tiscali.com... > On Sat, May 31, 2003 at 12:09:00AM +0900, ts wrote: > > >>>>> "B" == Brian Candler writes: > > > > B> Did someone propose implementing each_with_last in terms of select? > > > > see [ruby-talk:72510] > > Oh OK - make 'last?' a sort of pseudo-instance variable rather than passing > it as a parameter to each_with_last. Looks messy, as it splits the iterator > state: some carried by the iterator, and some carried outside it. It *is* messy. And it's exactly the reason why it will break concurrent iterations. robert