On Wed, Sep 26, 2007 at 12:59:36AM -0400, H. William Welliver III wrote:
yeah, but next() is optional and not used by foreach
There's no indication that next() is optional.
the documentation starts with: "If this function is defined"
it would be different if next() where the standard way of advancing the iterator.
Well, it is the "standard" way, [by "standard", I mean the pattern employed by C++, Java, Objective-C, etc] Pike just happens to use operator overloading instead.
i agree that when trying to use some iterator manually i was surprised at first when next() did not work.
greetings, martin.