From: Pit Capitain Date: 2006-03-24T22:38:55+09:00 Subject: Re: iterator class not working Peter Ertl schrieb: > Yield'ing and using Array.[] seems obvious but I want class 'Iterator' to > work for any 'Enumerable', not only 'Array'. > > The intention for using 'binding' is that I expect / hope it will keep track > of the enumeration state inside 'Enumeration.each'. However, I don't know if > that's possible in ruby at all. Peter, I think you can't use bindings for that. All the continuations based iterator implementations I've seen use at least two continuations. You can find them in the mailing list archives. Of course that's much less fun than implementing it for yourself. Regards, Pit