commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: [lang3] Pair
Date Fri, 04 Mar 2011 20:51:59 GMT
On 2011-03-04, Matt Benson wrote:

> Another interesting concept mentioned in this article is the
> summarized by the statement "Another way of formalizing tuples is as
> nested ordered pairs."  I would argue that this is the only efficient
> way to formally represent an n-tuple using Java generics without
> writing one class per value of n.

To go even further off topic 8-)

.NET 4's classlib has Tuple<T1, T2> up to one with nine generics and the
recommended approach for more than nine is to use a Tuple of appropriate
length as the last type of the nine generics Tuple.

The accessors are Item1 to Item9.

Given that .NET's generics implementation is quite a bit more advanced
than Java's they don't need to implement special cases for primitives.

> Call it a pair, call it an association, but let's call it done.

+1 even if I'm not even a user of [lang].


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message