From: ts Date: 2003-05-31T00:39:28+09:00 Subject: Re: Iteration - last detection >>>>> "B" == Brian Candler writes: B> Oh OK - make 'last?' a sort of pseudo-instance variable rather than passing B> it as a parameter to each_with_last. Looks messy, as it splits the iterator B> state: some carried by the iterator, and some carried outside it. But you don't solve the problem, in [ruby-talk:72510] you have >>>>> "C" == Carlos writes: C> class Array; include EachWithLast end C> a = [1,2,3,4,5].select {|e| last? } C> p a # => [5] 1.8 with not call the method EachWithLast#each Guy Decoux