BaseStream & Stream

Remi Forax forax at univ-mlv.fr
Sun Dec 2 02:48:03 PST 2012


On 12/02/2012 01:22 AM, Brian Goetz wrote:
> BaseStream currently serves the type system more than it serves the 
> user, which is a defect.  The user would never deal in a BaseStream; 
> the only place it shows up is in type constraints like Foo<S extends 
> BaseStream>.  Ideally we could get rid of it entirely. Now that the 
> design is stabilizing, this is a good time to explore that.

maybe, it can be declared non public if Foo is in the same package.

Rémi

>
> On 12/1/2012 7:02 PM, Remi Forax wrote:
>> Brian,
>> I think BaseStream (as supertype of Stream, IntStream, LongStream, etc)
>> is not the best design.
>> I see the fact that an IntStream should be view as a BaseStream as an
>> interopt issue,
>> I think it's better if IntStream has a method asStream that return a
>> Stream,
>> i.e. a real Stream not a strawman stream as BaseStream currently is.
>>
>> This design is in my opinion better because from the user point of view,
>> there is only one interface, Stream.
>> Note that java.nio.Buffer has a similar design.
>>
>> cheers,
>> Rémi
>>
>>
>>
>>



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