Whither extension methods?

Joshua Bloch jjb at google.com
Tue Dec 15 07:37:45 PST 2009


Not that I know of.  It sure would be nice.

           Josh

On Tue, Dec 15, 2009 at 4:42 AM, Roel Spilker <r.spilker at gmail.com> wrote:

> Josh, or Doug,
>
> Is there also a video or audio recording of Guy Steele's talk? I couldn't
> easily find it using my favorite search engine :-)
>
> Roel
>
> On Tue, Dec 15, 2009 at 8:46 AM, Joshua Bloch <jjb at google.com> wrote:
>
>> Doug Lea sent this a couple of days ago, and I think it deserves our
>> consideration:
>>
>> I confess to being a little confused about the rationale for extension
>> > methods.
>>
>>
>> > Suppose we have a Map, and want to some sort of apply-to-each-value
>> > operation. The only reasonable way to do this in parallel is to somehow
>> > splitthe work. But Map has no public methods allowing you to do this --
>> you
>> > can only get an iterator, which is inherently sequential. Now, if we
>> > could get at the representations, then we could actually do splits for
>> most
>> > java.util maps (at least for the most common ones -- HashMaps,
>> TreeMaps). So
>> > the only way I know for these to be bolted on is to introduce new
>> interfaces
>> > that each of the these existing classes could be changed to implement.
>> Or am
>> > I missing something?
>>
>>
>> > You might want to read Guy Steele's nice talk on related issues at
>> >
>> http://groups.csail.mit.edu/mac/users/gjs/6.945/readings/MITApril2009Steele.pdf
>>
>>
>> > -Doug
>>
>>
>


More information about the lambda-dev mailing list