Jump to page: 1 2
Thread overview
In the age of AliasSeq, how to refer to template tuple parameters?
Oct 01, 2015
Mike Parker
Oct 01, 2015
John Colvin
Oct 01, 2015
Mike Parker
Oct 01, 2015
Dicebot
Oct 01, 2015
Mike Parker
Oct 01, 2015
Dicebot
Oct 01, 2015
Jonathan M Davis
Oct 02, 2015
Mike Parker
Oct 02, 2015
Mike Parker
Oct 02, 2015
Dmitry Olshansky
Oct 02, 2015
Mike Parker
Oct 02, 2015
Dicebot
October 01, 2015
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
October 01, 2015
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.
October 01, 2015
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
October 01, 2015
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...
October 01, 2015
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.
October 01, 2015
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.
October 01, 2015
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
October 02, 2015
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".
October 02, 2015
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
October 02, 2015
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 :)
« First   ‹ Prev
1 2