digitalmars.D.learn - What difference between std.typecons.Tuple and std.meta.AliasSeq
- Suliman (11/11) Sep 20 2015 Sometimes it's hard to understand the D philosophy, for example
- Adam D. Ruppe (2/2) Sep 20 2015 AliasSeq is just a random collection of stuff.
- Alex Parrill (10/21) Sep 20 2015 std.typecons.Tuple is more like Python's tuples. It effectively
- John Colvin (2/5) Sep 20 2015 This is what is used inside std.typecons.Tuple
Sometimes it's hard to understand the D philosophy, for example now I can't understand diffrence between std.typecons.Tuple and std.meta.AliasSeq. I know that in language like Python there is spatial data type named tuple like: tup1 = ('physics', 'chemistry', 1997, 2000); But what in D? That was Tuples module, but it's look like it was renamed to http://forum.dlang.org/thread/mnhfhs$2b9o$1 digitalmars.com But look like std.typecons.Tuple and std.meta.AliasSeq are exists. So I really can't understand what and how I should to use that's all.
Sep 20 2015
AliasSeq is just a random collection of stuff. A Tuple is more like a struct.
Sep 20 2015
On Sunday, 20 September 2015 at 18:10:49 UTC, Suliman wrote:Sometimes it's hard to understand the D philosophy, for example now I can't understand diffrence between std.typecons.Tuple and std.meta.AliasSeq. I know that in language like Python there is spatial data type named tuple like: tup1 = ('physics', 'chemistry', 1997, 2000); But what in D? That was Tuples module, but it's look like it was renamed to http://forum.dlang.org/thread/mnhfhs$2b9o$1 digitalmars.com But look like std.typecons.Tuple and std.meta.AliasSeq are exists. So I really can't understand what and how I should to use that's all.std.typecons.Tuple is more like Python's tuples. It effectively defines a struct with one field per type in the tuple definition, and only holds values. std.meta.AliasSeq (aka std.typetuple.TypeTuple) is a compile-time construct, used mostly with templates, and is more like a list. They can hold types, values, or symbol aliases, but only exist during compilation (though you can declare a variable using an AliasSeq containing only types; I think this acts like defining one variable for each type in the seq).
Sep 20 2015
On Sunday, 20 September 2015 at 18:28:13 UTC, Alex Parrill wrote:(though you can declare a variable using an AliasSeq containing only types; I think this acts like defining one variable for each type in the seq).This is what is used inside std.typecons.Tuple
Sep 20 2015