A Discussion of Tuple Syntax

Dicebot public at dicebot.lv
Mon Aug 19 11:37:30 PDT 2013


On Monday, 19 August 2013 at 18:19:11 UTC, bearophile wrote:
> Mine was an idea, but if it turns out to be a bad idea, then 
> let's ignore it.

I was initially completely opposed against it but now that I have 
realized built-in ones do some run-time magic too, it does not 
sound _that_ crazy anymore.

Seriously, if current std.typecons.Tuple is implemented in terms 
if built-in tuple, than it sounds like only think built-in ones 
are lacking is ABI. Define it and using one single tuple syntax / 
implementation for everything becomes real.

I mean:

import std.typecons;
import std.typetuple;

void main()
{
	alias TT = TypeTuple!(int, string);
	
         // moar confusion for gods of confusion!
         // what is the difference between twoVars1 and twoVars2 
other than latter is wrapped into struct and has ABI?
	TT twoVars1;
	Tuple!(int, string) twoVars2;
}


More information about the Digitalmars-d mailing list