www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - In the age of AliasSeq, how to refer to template tuple parameters?

reply Mike Parker <aldacron gmail.com> writes:
What's the official way to refer to T... now? In std.meta, I see 
this for AliasSeq:

/**
  * Creates a sequence of zero or more aliases. This is most 
commonly
  * used as template parameters or arguments.
  */

This implies "sequence parameters". But the documentation at [1] 
still uses Template Tuple Parameters. I'm in the process of 
revising the template chapter of Learning D and I need to know 
how to refer to these now. It was originally written before 
AliasSeq came along, so I've used "tuple parameters", "type 
tuple" and "expression tuple" to refer to these. Do I need to 
change them?

[1] http://dlang.org/template.html#TemplateTupleParameter
Oct 01 2015
next sibling parent reply John Colvin <john.loughran.colvin gmail.com> writes:
On Thursday, 1 October 2015 at 08:20:52 UTC, Mike Parker wrote:
 What's the official way to refer to T... now? In std.meta, I 
 see this for AliasSeq:

 /**
  * Creates a sequence of zero or more aliases. This is most 
 commonly
  * used as template parameters or arguments.
  */

 This implies "sequence parameters". But the documentation at 
 [1] still uses Template Tuple Parameters. I'm in the process of 
 revising the template chapter of Learning D and I need to know 
 how to refer to these now. It was originally written before 
 AliasSeq came along, so I've used "tuple parameters", "type 
 tuple" and "expression tuple" to refer to these. Do I need to 
 change them?

 [1] http://dlang.org/template.html#TemplateTupleParameter
One approach would be to just call them an AliasSeq, defined as "a sequence of aliases, such as what is created by variadic template parameters". Then you have to deal with explaining how storage classes can end up in AliasSeqs, but std.meta.AliasSeq will strip them out... It's a bit embarrassing.
Oct 01 2015
parent Mike Parker <aldacron gmail.com> writes:
On Thursday, 1 October 2015 at 08:30:15 UTC, John Colvin wrote:

 One approach would be to just call them an AliasSeq, defined as 
 "a sequence of aliases, such as what is created by variadic 
 template parameters". Then you have to deal with explaining how 
 storage classes can end up in AliasSeqs, but std.meta.AliasSeq 
 will strip them out...

 It's a bit embarrassing
Indeed. Whatever approach I take, there's certainly going to be a need for an aside to address all the different terminology.
Oct 01 2015
prev sibling next sibling parent reply Dicebot <public dicebot.lv> writes:
On Thursday, 1 October 2015 at 08:20:52 UTC, Mike Parker wrote:
 What's the official way to refer to T... now? In std.meta, I 
 see this for AliasSeq:

 /**
  * Creates a sequence of zero or more aliases. This is most 
 commonly
  * used as template parameters or arguments.
  */

 This implies "sequence parameters". But the documentation at 
 [1] still uses Template Tuple Parameters. I'm in the process of 
 revising the template chapter of Learning D and I need to know 
 how to refer to these now. It was originally written before 
 AliasSeq came along, so I've used "tuple parameters", "type 
 tuple" and "expression tuple" to refer to these. Do I need to 
 change them?

 [1] http://dlang.org/template.html#TemplateTupleParameter
Do you want to refer to `T...` as a syntax feature or actual arguments? Former is called "template tuple parameter" as you correctly linked indeed, but for latter there is http://dlang.org/template.html#TemplateArgumentList
Oct 01 2015
parent reply Mike Parker <aldacron gmail.com> writes:
On Thursday, 1 October 2015 at 09:43:10 UTC, Dicebot wrote:
 Do you want to refer to `T...` as a syntax feature or actual 
 arguments? Former is called "template tuple parameter" as you 
 correctly linked indeed, but for latter there is 
 http://dlang.org/template.html#TemplateArgumentList
Both. I'm hesitant to use Template Tuple Parameter until I can know for sure that's what they will continue to be called. "template argument list" seems like it could be confusing. Typically, a function argument list refers to all the arguments passed to the function. Given multiple template parameters with a T... at the end, I would expect template argument list to refer to all of them, not just the T...
Oct 01 2015
parent reply Dicebot <public dicebot.lv> writes:
On Thursday, 1 October 2015 at 11:23:51 UTC, Mike Parker wrote:
 On Thursday, 1 October 2015 at 09:43:10 UTC, Dicebot wrote:
 Do you want to refer to `T...` as a syntax feature or actual 
 arguments? Former is called "template tuple parameter" as you 
 correctly linked indeed, but for latter there is 
 http://dlang.org/template.html#TemplateArgumentList
Both. I'm hesitant to use Template Tuple Parameter until I can know for sure that's what they will continue to be called. "template argument list" seems like it could be confusing. Typically, a function argument list refers to all the arguments passed to the function. Given multiple template parameters with a T... at the end, I would expect template argument list to refer to all of them, not just the T...
Naturally, a slice of argument list is still an argument list (just smaller one) ;) But on general topic - no, there is no clear and non-confusing terminology on this topic and there have never been.
Oct 01 2015
parent Jonathan M Davis <jmdavisProg gmx.com> writes:
On Thursday, 1 October 2015 at 11:28:17 UTC, Dicebot wrote:
 On Thursday, 1 October 2015 at 11:23:51 UTC, Mike Parker wrote:
 On Thursday, 1 October 2015 at 09:43:10 UTC, Dicebot wrote:
 Do you want to refer to `T...` as a syntax feature or actual 
 arguments? Former is called "template tuple parameter" as you 
 correctly linked indeed, but for latter there is 
 http://dlang.org/template.html#TemplateArgumentList
Both. I'm hesitant to use Template Tuple Parameter until I can know for sure that's what they will continue to be called. "template argument list" seems like it could be confusing. Typically, a function argument list refers to all the arguments passed to the function. Given multiple template parameters with a T... at the end, I would expect template argument list to refer to all of them, not just the T...
Naturally, a slice of argument list is still an argument list (just smaller one) ;) But on general topic - no, there is no clear and non-confusing terminology on this topic and there have never been.
In general, I'd just use the term AliasSeq for it all at this point, since that's what we're calling it in Phobos now, which should work well enough for those who already know what it is, but when you have to actually explain it, things get more complicated very quickly - and the fact that it's a language construct that we interact with via a library construct rather than really interacting with it directly doesn't help... - Jonathan M Davis
Oct 01 2015
prev sibling parent reply Mike Parker <aldacron gmail.com> writes:
On Thursday, 1 October 2015 at 08:20:52 UTC, Mike Parker wrote:
 What's the official way to refer to T... now? In std.meta,
On a whim, I went to [1], which I had previously referenced in the book, and found that all of the content that was previously there has been replaced by a couple of sentences pointing to std.typecons and to [2]. It also says we should no longer refer tuple is now discouraged in reference to T.... The second link is all about Compile-Time Argument Lists, which is apparently the new name. If that's the case, then the template docs need to be updated so that they no longer refer to "Template Tuple Parameters".
Oct 02 2015
next sibling parent reply Mike Parker <aldacron gmail.com> writes:
On Friday, 2 October 2015 at 12:31:35 UTC, Mike Parker wrote:
 On a whim, I went to [1], which I had previously referenced in 
 the book, and found that all of the content that was previously 
 there has been replaced by a couple of sentences pointing to 
 std.typecons and to [2]. It also says we should no longer refer
[1] http://dlang.org/tuple.html [2] http://dlang.org/ctarguments.html
Oct 02 2015
parent reply Dmitry Olshansky <dmitry.olsh gmail.com> writes:
On 02-Oct-2015 15:32, Mike Parker wrote:
 On Friday, 2 October 2015 at 12:31:35 UTC, Mike Parker wrote:
 On a whim, I went to [1], which I had previously referenced in the
 book, and found that all of the content that was previously there has
 been replaced by a couple of sentences pointing to std.typecons and to
 [2]. It also says we should no longer refer
[1] http://dlang.org/tuple.html [2] http://dlang.org/ctarguments.html
Article used terminology that was then changed sadly nobody felt strong enough to rewrite the article to use AliasSeq (the e-hm actual new name). -- Dmitry Olshansky
Oct 02 2015
parent Mike Parker <aldacron gmail.com> writes:
On Friday, 2 October 2015 at 12:40:02 UTC, Dmitry Olshansky wrote:
 On 02-Oct-2015 15:32, Mike Parker wrote:
 On Friday, 2 October 2015 at 12:31:35 UTC, Mike Parker wrote:
 On a whim, I went to [1], which I had previously referenced 
 in the
 book, and found that all of the content that was previously 
 there has
 been replaced by a couple of sentences pointing to 
 std.typecons and to
 [2]. It also says we should no longer refer
[1] http://dlang.org/tuple.html [2] http://dlang.org/ctarguments.html
Article used terminology that was then changed sadly nobody felt strong enough to rewrite the article to use AliasSeq (the e-hm actual new name).
I see. Well, it does mention AliasSeq. While that may work for the std.meta template, I just don't see how that's even a remotely useful name for T... It really was much easier to explain the tuple mess before these changes were made.
Oct 02 2015
prev sibling parent Dicebot <public dicebot.lv> writes:
On Friday, 2 October 2015 at 12:31:35 UTC, Mike Parker wrote:
 The second link is all about Compile-Time Argument Lists, which 
 is apparently the new name.
Heh, I have written that second article for initial `std.meta` PR (one that used name `MetaList` and got reverted eventually). Looks like it was still merged with some modification for `AliasSeq` but uses my old terminology in some places. I'd warn against taking it as very official source :)
Oct 02 2015