JEP 186: Collection Literals

Zhong Yu zhong.j.yu at gmail.com
Thu Feb 20 11:55:15 PST 2014


another design:

    Map.k(k1, k2, ...)
           .v(v1, v2, ...)

but they all suck. We need literals for pair/tuples badly. Not so much
for homogeneous collections.

Zhong Yu



On Thu, Feb 20, 2014 at 9:14 AM, Remi Forax <forax at univ-mlv.fr> wrote:
> On 02/20/2014 03:47 PM, Stephen Colebourne wrote:
> [...]
>
>> Personally, I can't see how a builder can possibly be as neat as
>> List.of(1, 2, 3).
>>
>> Stephen
>
> It's not incompatible,
>    Map.of(1, "foo").of(2, "bar").toMap();
>
> Rémi
>
>


More information about the lambda-dev mailing list