What is a tuple and why should one care?
Michel Fortin
michel.fortin at michelf.com
Fri Oct 8 05:54:16 PDT 2010
On 2010-10-08 08:37:39 -0400, Justin Johansson <no at spam.com> said:
> There's a lot of (imho, pointless) discussion going on about
> tuples in D.
>
> I've asked before and haven't any illumination, especially of Walter.
>
> In the context of D, can someone please enlighten me as to exactly
> what a tuple is supposed to be.
>
> The discussion so far appears to me to be focusing on syntax
> for these "tuple thing-a-m-be's" without defining what the bloody
> thing-are-might-be's are.
>
> Thanks in advance for zen enlightenment,
> Justin Johansson
D currently has two different kinds of tuple: the one in the
language[1], which is created by variadic template arguments, and the
one in the standard library[2], which is a struct wrapper for the first
kind that addresses a couple of its shortcomings and adds named fields.
My understanding is that Walter wants to improve the language tuple by
making it possible to return one from a function and giving it a
literal syntax while Andrei would prefer to continue using the
library-based tuple. Personally, I'd prefer if we had only one kind of
tuple because it makes discussions on this subject really confusing.
[1]: http://www.digitalmars.com/d/2.0/template.html#TemplateTupleParameter
[2]: http://www.digitalmars.com/d/2.0/phobos/std_typecons.html
--
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/
More information about the Digitalmars-d
mailing list