A Discussion of Tuple Syntax

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue Aug 20 13:16:48 PDT 2013


On 8/20/13 6:57 AM, Dicebot wrote:
> I am proposing something more radical. Deprecate _both_ TypeTuple and
> Tuple. Clearly define the difference between built-in type tuple and
> expression tuple (latter being instance of former).

But that can't be the case.

> Preserve
> auto-expansion.

That would be problematic to say the least. (There have been a few 
discussions in this group; I've come to think auto expansion is fail.)

> Provide two different literals to remove ambiguity
> between referencing symbol as a value and referencing it as an alias.
> Make compiler auto-generate Tuple-like struct type for expression tuples
> that need to be returned from functions. Create some new type in
> std.typecons for those who don't want auto-expansion.
>
> It won't even break stuff.

That sounds good :o).


Andrei


More information about the Digitalmars-d mailing list