RE: [functor] Iterator and Generator

2003-07-19 Thread Rodney Waldhoff
Maybe that post came out with the wrong emphasis. I'm not trying to say we should prefer external iterators to internal ones, indeed much of the value of commons-functor comes from replacing external iteration with internal iteration. It just seems that if you add a next() method to Generator, th

RE: [functor] Iterator and Generator

2003-07-18 Thread Jason Horman
I think there are a few reasons that generators may be better than or a compliment to iterators. They are somewhat easier to write. You literally just write a loop that calls a function on each iteration. Writing a generator as an anon inner class is easier since there is only 1 method to implem

Re: [functor] Iterator and Generator

2003-07-18 Thread Mark R. Diggory
At first blush (and not having any experience actually using Generators directly) I guess the questionability for me lies in the issue of how often would someone want to create a Generator that is not an Iterator. -Mark Rodney Waldhoff wrote: As far as I can tell, the role of generator is essen