Hi Mark Randall,

> These functions make sense. However I think we need to give renewed 
> consideration to:
> 
> $itr->all();
> $itr->some(...);

That wouldn't help for arrays, which would be the most common use case - I 
don't remember seeing an RFC for https://github.com/nikic/scalar_objects and 
that is a much larger language change.

This also wouldn't help if I wanted something that could be used on any 
Traversable.
Currently, there's no support for default methods for interfaces such as 
Iterator/IteratorAggregate - I think I saw some discussion of that.
(e.g. to check for any()/all() on generators, user-defined classes, etc)
Backwards compatibility of method signatures with the same names that were 
written before default methods were added would be a concern, though.
(https://docs.oracle.com/javase/tutorial/java/IandI/defaultmethods.html)

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

Reply via email to