Stream operations -- current set
Andrey Breslav
andrey.breslav at jetbrains.com
Sun Oct 7 12:10:31 PDT 2012
> Its not strictly about efficiency; its about presenting a programming model that is consistent and effective for the users. Sorting shows up in the middle of a pipeline frequently enough that moving it outside the model makes it less useful.
Then, it seems that my problem would be solved by renaming some things: e.g., if we stop calling things "lazy" when they are lazy only in a special sense (albeit technically very correct). Or we could say something else instead of "stream", because sorting a stream feels wrong… Not that I had a particular name in mind, but it seems that there may be room for improvement.
From the pedagogical perspective, it is super-important to keep the concepts names as neatly as possible, otherwise we'll struggle with lots of strings attached while explaining these APIs.
>> BTW, we could create a Destination that wraps an array and the users could retrieve it from there. This way we'd get rid of toArray() altogether, which seems appealing to me.
> Yes, such wrappers exist in Arrays.
Then I'd be happy to drop toArray() from Stream.
--
Andrey Breslav
http://jetbrains.com
Develop with pleasure!
More information about the lambda-libs-spec-experts
mailing list