DIP54 : revamp of Phobos tuple types

Dicebot public at dicebot.lv
Mon Dec 23 03:58:05 PST 2013


On Monday, 23 December 2013 at 03:45:07 UTC, Jakob Ovrum wrote:
>> We can't afford to add even more "tuple" types in library.
>
> One tuple and two compile-time lists - where the auto-expanding 
> one covers the vast majority of use cases - doesn't sound at 
> all bad.

I think this is the root cause of disagreement and everything 
else is just a consequence from it. I still remember my initial 
confusion when trying to figure out this part of the language - 
it wasn't really related to naming but more about trying to 
understand what intended use cases does each entity have. It is 
all natural once you start to casually use it but not before. If 
both types are present in the library in the same time we will 
need to explain why both are needed, what is the difference, when 
each is expected to be used and so on. It is a serious risk of 
cognitive overload considering one is already expected to get 
some grasp about native template argument lists and how those can 
be used. If there is only one type, it becomes considerably more 
simple - just use it and once you get familiar with it deep 
enough to need expansion behavior - `.expand` will be an expected 
discovery.

Also having both types at the same time will cause difficulties 
with template algorithms currently present in std.typetuple - 
having some defined in terms of raw argument list and others in 
terms of packed TemplateArgumentList is just another learning 
curve damage.

What is even more important - auto-expanding lists simply don't 
have any important value to preserve on their own as they are 
already present in form of raw template arguments and `.expand`. 
This was what made me change opinion on this topic back then.


More information about the Digitalmars-d mailing list