Well we don't have very much time anymore because I want to roll RC1 ASAP (assuming that we get a couple of bugs fixed which need fixing).
Personally I'm fine with either of these (I don't mind hasMore()) but a decision has to be reached quickly. From discussing with Marcus I don't think he feels very strongly about it but like me doesn't think hasMore() is so bad. People are used to this semantics IMO.


At 09:03 AM 3/1/2004 -0500, Hans Lellelid wrote:
Hi Marcus,

Andrei Zmievski wrote:
On Thu, 26 Feb 2004, Philip Fletcher wrote:

Looking at the documentation, the comments and method name (for hasMore())
do not have the same meaning - the comment is saying 'does the current
element exist?' and the method name says 'are there any more elements?'.

This makes the api very ambiguous - hasMore() and isValid() have very
specific meaning in many languages wrt iterators.

I agree. The semantics are fairly different. Let's not confuse them.

I also agree strongly with the need for this to get fixed before PHP goes to release. IMO the current hasMore() is very misleading and has the result that people can't intuitively use it outside of the foreach() context.


Whether the method is called isValid() or something else that makes sense is less important to me, but providing an intuitive interface that won't leave code users scratching their heads or submitting bug reports for what appears to be faulty implementing iterator logic is really important.

BTW, Iterators are awesome(!), and it's only because they are so awesome & everyone will use them that I think this is important to address before release.

Thanks,
Hans

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to