A Discussion of Tuple Syntax

Meta jared771 at gmail.com
Tue Aug 20 20:55:17 PDT 2013


On Wednesday, 21 August 2013 at 00:38:31 UTC, Andrei Alexandrescu 
wrote:
> 1. What do we need?

Nothing. Everything discussed thus far can already be done in D, 
but with either a little or a lot of tedium and error-prone 
hackery. What I think would benefit D is a 
cleanup/simplification/sugarization of the current tuple 
situation. TypeTuple causes no end of grief and confusion.

> 2. What does a solution look like in the current language?

See Kenji's DIP for Bearophile's example of tuple use in the 
current language. Throughout this discussion there have also been 
several other examples of how TypeTuple misbehaves.

> 3. Which parts of the solution are frequent/cumbersome enough 
> to warrant a language change?

IMO, TypeTuple auto-expansion and mixing of data/types within the 
same TypeTuple. It's also annoying that TypeTuples are not 
first-class values, and it would be a pity if we did not come up 
with some sort of tuple literal syntax, but that situation can be 
worked around by wrapping it in Tuple.

> Instead there have been 1001 proposals for new syntax for tuple 
> literals, one cuter than the next.

Wouldn't you call this characterization a little unfair, when 
there were numerous posts also discussing relevant issues and 
semantics? I'd say the ratio of form:function has been pretty 
good thus far.



More information about the Digitalmars-d mailing list