Fwd: toMap method in Collection

Brian Goetz brian.goetz at oracle.com
Sun Nov 20 05:45:30 PST 2011


> Still, it bothers me that because of the choice to use defender
> methods, and not allow anyone other than oracle to create these
> methods this thread should spend time working on the API of
> collections. Trying to balance which methods will be useful to people
> vs. which methods are too obscure and will add clutter to the API.
>
> Either way, API design of collections shouldn't be part of the Lambda
> Language design, and it strikes me that part of the problem with
> defender methods is that it doesn't prevent the API design from
> entering into the conversation.

Indeed, the two are separate efforts, involving separate (but 
overlapping and communicating) teams.  But it is not an accident that 
the two are happening at the same time.  Since lambda is in no small 
part about enabling libraries, it would be stupid to theorize in a 
vacuum about library-enabling language features without trying to 
actually use them to write libraries.  Otherwise we would miss the 
window for the libraries effort to provide feedback to the language 
effort.

It has always been this way: generics were added to Java at the same 
time the libraries were generified; the C++ template features were 
developed at roughly the same time as STL; the LinQ libraries were 
developed at the same time as the LinQ language features.  So, the two 
are separate, but coupled, as it should be.  This is not an accident.

I get that you would have preferred use-site extension methods to 
declaration-site extension methods, but that has nothing to do with 
whether or not it makes sense to talk about libraries now.  Let's 
stipulate that you don't agree with our language design choice, and move 
on.




More information about the lambda-dev mailing list