Yet another MRV proposal!

Janice Caron caron800 at googlemail.com
Tue Apr 15 06:42:30 PDT 2008


On 15/04/2008, Bill Baxter <dnewsgroup at billbaxter.com> wrote:
>  TypeTuples are much closer to what is called a tuple in other languages.
>
>     TypeTuple!(int,float,string) x;
>     x[0] = 3;
>     x[1] = 2.5;
>     x[2] = "hello";

Where is TypeTuple! defined?


> An ordered, fixed-sized list of anonymous items of fixed,
> but arbitrary type.

Yep, that's a std.typecons.Tuple.

A "Walter Tuple" is a list of arbitrary values and types, for example
( int, float, 42, "hello" ).

An "Andrei Tuple" is an ordered, fixed-sized list of items of fixed
but arbitrary type.

(Andrei also lets you name some or all of the items if you want, so
they don't /have/ to be anonymous, but naming the fields is optional.
Think of that as an extra bonus feature).



More information about the Digitalmars-d mailing list