Stream and Iterator

Howard Lovatt howard.lovatt at gmail.com
Mon Dec 3 21:37:42 PST 2012


+1 for Remi's suggestion

 -- Howard  

Sent from my iPad

On 02/12/2012, at 9:46 PM, Remi Forax <forax at univ-mlv.fr> wrote:

> On 12/02/2012 01:19 AM, Brian Goetz wrote:
>> Because the common understanding of "Iterable" is that you can repeatedly ask for an Iterator.  Yes, I know that the spec doesn't say that, but that's how it's understood.  Asking for an Iterator is not the common way of accessing a stream's elements; it's an escape hatch.
> 
> agree.
> 
>> Making it Iterable would only call attention to this and confuse people.
> 
> so iterator() and spliterator() should nt be part of the interface too but accessible through a method call,
> something like stream.escapeHatch().iterator(), and the interface EscapeHatch can be Iterable.
> Note that from the implementation POV espaceHatch() can just return this.
> 
> Rémi
> 
>> 
>> 
>> 
>> On 12/1/2012 7:02 PM, Remi Forax wrote:
>>> Why Stream is not Iterable now that it has a method iterator() ?
>>> 
>>> Rémi
> 


More information about the lambda-libs-spec-observers mailing list