DIP54 : revamp of Phobos tuple types

Dicebot public at dicebot.lv
Mon Dec 23 05:24:26 PST 2013


On Monday, 23 December 2013 at 13:13:13 UTC, monarch_dodra wrote:
> On Monday, 23 December 2013 at 12:25:55 UTC, Dicebot wrote:
>> On Monday, 23 December 2013 at 12:03:05 UTC, ilya-stromberg 
>> wrote:
>>> Can we add alias for `auto-expansion TypeTuple` and add link 
>>> to the previous documentation like this:
>>>
>>> alias ExpandedTemplateArgumentList(T) = 
>>> TemplateArgumentList!(T).expand;
>>>
>>> It looks like it can fix all objections here.
>>
>> What is this supposed to give over just using .expand 
>> directly? I have not seen a good rationale that justifies it 
>> among existing objections, probably have missed it.
>
> It allows doing a simple 
> 's/TypeTuple/ExpandedTemplateArgumentList/'
>
> Using "TemplateArgumentList!(T).expand" is a "much" more 
> involved transition: It's not just a simple rename.

%s/TypeTuple!(\([^)]*\))/TemplateArgumentList!(\1).expand/g ? :) 
Yes it will fail for few cases where there is a string with ")" 
among parameters, but same applies to 
s/TypeTuple/ExpandedTemplateArgumentList/; it still is a simple 
rename

Though algorithms in std.typetuple are supposed to be changed to 
have interface based on paced one when copied to std.meta.* so in 
practice it will be just s/TypeTuple/TemplateArgumentList/

Even if user attention will be needed to every single use point 
(which is not true), it is not justified enough objection - this 
is what deprecation process is for. No silent breakage is 
possible and this is only thing that really matters in this 
context.


More information about the Digitalmars-d mailing list