Design for collections upgrades

Brian Goetz brian.goetz at oracle.com
Tue Mar 8 12:28:44 PST 2011


On 3/8/2011 2:54 PM, Sam Pullara wrote:
> Or just overload filter with a second argument that is the collection
> you would like to add to. What is nice about the lazy collections is
> that you don't need to generate intermediate collections at all and
> can much more efficiently chain them. Perhaps make them all lazy and
> require a .to() at the end if you want a Collection vs a Stream?

The nice thing about the explicit option is that it supports two 
different use cases -- "construct me a new collection" (functional 
composition) and "add them to an existing collection" (union operations).


More information about the lambda-dev mailing list