From: Brian Candler Date: 2003-05-31T00:32:44+09:00 Subject: Re: Iteration - last detection 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. Cheers, Brian.