Code smell? Iterator prototype has iterator method that returns "this"

John Lenz concavelenz at
Mon Jul 25 15:19:56 UTC 2016

This seems ripe for misuse:  you don't want two "owners" for the same
iterator calling "next" and normally, without the Iterator interface
implementation, you would expect "iterator()" to always return an instance
of the iterator that the caller "owned".

Can anyone provide any historical context on why this method was added to
the "iterator"?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list