java.util.Pair
kedar mhaswade
kedar.mhaswade at gmail.com
Fri Jul 14 04:50:07 UTC 2017
On Thu, Jul 13, 2017 at 4:24 PM, Dave Brosius <dbrosius at mebigfatguy.com>
wrote:
> I would avoid Pair and Entry like the plague. They are devoid of meaning
> and are just there to save your fingers.
The only difference is that the latter is already available in java.util.
And perhaps it is (should be?) more attractive to a typical Java developer
to use Entry than depend upon JavaFX (is that available in headless
environment?)
If that is your main impetus, i'd just turn to using lombok and have true
> bean classes, that are finger-cost free.
>
>
>
> On 07/13/2017 05:41 PM, forax at univ-mlv.fr wrote:
>
>> De: "John Rose" <john.r.rose at oracle.com>
>>> À: "Rémi Forax" <forax at univ-mlv.fr>
>>> Cc: "joe darcy" <joe.darcy at oracle.com>, "core-libs-dev"
>>> <core-libs-dev at openjdk.java.net>
>>> Envoyé: Jeudi 13 Juillet 2017 23:05:14
>>> Objet: Re: java.util.Pair
>>> On Jul 13, 2017, at 1:39 PM, Remi Forax < [ mailto:forax at univ-mlv.fr |
>>> forax at univ-mlv.fr ] > wrote:
>>>
>>>> Tuples are like an array of value types parameterized by a constant
>>>> integer
>>>>
>>> The homogeneous case is pretty simple; most of what you need is
>>> to allow a generic type to be parameterized by an integer. C++ templates
>>> have had that for a long time.
>>> What's harder is to have a two-step process for type instantiation:
>>> First, tell me the arity N, and second, for each position under that
>>> arity,
>>> tell me the type T[i], i<N. (And don't break type inference.) I think
>>> the most Java-like way to handle it might be type-functions that overload
>>> alongside generic types. But there are many, many ways to slice it.
>>>
>> or use a recursive definition like in Ceylon
>> https://modules.ceylon-lang.org/repo/1/ceylon/language/1.0.
>> 0/module-doc/Tuple.type.html
>> and the fact that value types are flatten to specify the rest, i.e a
>> Tuple contains a T first and a Tuple rest.
>>
>> C++ templates can express heterogeneous tuples:
>>> [ http://en.cppreference.com/w/cpp/utility/tuple |
>>> http://en.cppreference.com/w/cpp/utility/tuple ]
>>> Typically there is a small limit to C++ tuple size, because the
>>> underlying
>>> template implementation has its size set to the arity limit.
>>> — John
>>>
>> Rémi
>>
>>
>
More information about the core-libs-dev
mailing list