list literal gotcha and suggestion

Reinier Zwitserloot reinier at zwitserloot.com
Tue Sep 29 00:52:06 PDT 2009


new HashSet<>(["a", "b", "c"]);

is too much effort in the rare cases where you need to initialize a  
set-typed parameter? This is java, not perl. Golfing isn't the end goal.

  --Reinier Zwitserloot


On 2009/29/09, at 09:42, Mark Thornton wrote:

> Reinier Zwitserloot wrote:
>> So, let's turn this argument on its head: Why are we trying so hard  
>> to  make set literals work? Why don't we just remove them from the   
>> proposal? The need for them seems minor compared to lists. When  
>> the  collection size is small (below about a 100), O(1) lookup  
>> performance  is irrelevant (and even if it was relevant, due to the  
>> extra
> So that we can supply them as arguments to methods that take a Set  
> and onot a List or Collection, or to initialise Set typed fields.
>
> Mark Thornton
>




More information about the coin-dev mailing list