tee()

Kevin Bourrillion kevinb at google.com
Thu Jan 24 13:02:51 PST 2013


On Thu, Jan 24, 2013 at 12:53 PM, Brian Goetz <brian.goetz at oracle.com>wrote:

Don convinced me of the need for this one when he described experiences his
> team had adapting to lazy collections in their libraries.


Depending on the details of that conversation, I either buy it or don't buy
it. :-)

Lazy collections are a whole other story; Collection<E> gets returned from
API X and passed into API Y and people don't realize it; that lazy
evaluation happens god-knows-when.  Stream<E> makes that a lot better.



On 1/24/2013 3:43 PM, Kevin Bourrillion wrote:
>
>> tee() stands out like a sore thumb.  I'm not surprised that Brian says
>> "this method is mostly for debugging."
>>
>> It just feels very, very strange to let the user inject a side-effect
>> into the middle of their stream somewhere, for mysterious hidden later
>> execution /maybe/.
>>
>>
>> If it really must stay, I think I do like "peek" or "observe" over
>> "tee". But I would love to drop it.
>>
>> --
>> Kevin Bourrillion | Java Librarian | Google, Inc. |kevinb at google.com
>> <mailto:kevinb at google.com>
>>
>


-- 
Kevin Bourrillion | Java Librarian | Google, Inc. | kevinb at google.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/lambda-libs-spec-experts/attachments/20130124/01aa7809/attachment.html 


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