Hello Eric,

  our iterators have next() and valid() in separate functions. That alone
makes them way more powerful then java' iterators. In SPL we have an
iterator wrapper called CachingIterator that has a method has_more()
which has a boolean return value that allows to check whether a call to
next() leaves the iterator valid or not. So changing the name would only
add confusion.

best regards
marcus

Sunday, June 4, 2006, 1:17:55 PM, you wrote:

> Hi,

> Took from Java world, it could be something like array_has_next() which is
> more significant because return boolean is only about the next value not
> about all the next values.

> On 6/3/06, Marcus Boerger <[EMAIL PROTECTED]> wrote:
>>
>> Hello Andi,
>>
>> Wednesday, May 31, 2006, 5:28:47 AM, you wrote:
>>
>> > Zeev and I designed each() to deprecate key()/current()/etc. which
>> > came from PHP/FI 2. Maybe not exactly what you're looking for but
>> > just want to point out that there have always been some issues with
>> > the latter functions.
>> > If each() isn't suitable (and/or you want something quicker) than I'm
>> > OK with an array_* function but I don't like array_valid(). It sounds
>> > too much like is_array() and implies the array is valid. Maybe
>> > something like array_valid_position()?
>>
>> Also good, i just chose the name becuase it's close to Iterator::valid().
>> I am however more interested in the array_has_more() thingie. Often enough
>> one runs into a problem where the last entry of a list has a slightly
>> different behavior.
>>
>> > At 02:52 PM 5/27/2006, Marcus Boerger wrote:
>> >>Hello Matthew,
>> >>
>> >>Saturday, May 27, 2006, 11:36:16 PM, you wrote:
>> >>
>> >> > Pierre wrote:
>> >> >> On 5/27/06, Marcus Boerger <[EMAIL PROTECTED]> wrote:
>> >> >>> - bool array(array $array)
>> >> >>>
>> >> >>>   cehcks whether arra position is valid (e.g. like "key($array) !==
>> >> >>> NULL")
>> >> >>
>> >> >> I don't understand this one.
>> >> >>
>> >>
>> >> > I think you have to listen to psychedelic music and take a hit of
>> >> LSD first.
>> >>
>> >>Actually the point is that you cannot simply do stuff like
>> >>"while(key($array))". And "while(key($array) != 0)" doesn't work either.
>> >>Also "if (!key($array))" is probably different from what you expect.
>> >>And of course "isset(key($array))" doens't work either.
>> >>
>> >>Best regards,
>> >>  Marcus
>> >>
>> >>--
>> >>PHP Internals - PHP Runtime Development Mailing List
>> >>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>
>>
>> Best regards,
>> Marcus
>>
>> --
>> PHP Internals - PHP Runtime Development Mailing List
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>



Best regards,
 Marcus

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

Reply via email to