Julian Snitow <vangczung / yahoo.com> wrote in message 
[ cut ]
> 
> Also, it just occured to me that it might be more Rubylike to have a 
> mixin method like
> 
> module Iteration
>    class ExternalIterator
>       # class definition same as above
>    end
> 
>    def iter
> 	ExternalIterator.new(self)
>    end
> end
> 
> Then you'd just do something like
> 
> class Array
>    include Iteration
> end
> 
> ex = ["foo", "bar", "baz", "qux", "florp", "bzaa", "worble"].iter
> 
> # then call ex.get whenever you want the next value
> ###################################

It may be more Rubyesque, but unfortunately it doesn't work:

puts ex.get
puts "---"
puts ex.get
puts "***"

produces:
foo
---
bar
---
baz
---
qux
---
florp
---
bzaa
---
worble
---
nil
---
foo
***