From: Geert Fannes Date: 2005-06-03T19:07:03+09:00 Subject: Re: internal iterators in ruby So, if I understand well, the problem with iterating over different enumerables synchronously has to do with the absence of a #rewind and #next method for enumerables. The Generator class solves this using the slow #callcc method and allows one to step through the Enumerable#each method, element by element. Wouldn't it be better if the enumerable required a #rewind and #next method and constructs the #each method out of these instead of doing the reverse using #callcc? Greetings, Geert Fannes. You code works only for arrays, but it's quite efficient. This works for all Enumerable types, is less efficient - and it's part of the std lib: http://www.ruby-doc.org/stdlib/libdoc/generator/rdoc/classes/SyncEnumera tor.html Know your standard libs... :-) Kind regards robert