I dun a DIP, possibly the best DIP ever

Piotr Mitana piotr.mitana at gmail.com
Fri Apr 24 07:18:39 UTC 2020


My two cents; the idea is nice, however I would consider a bit 
different syntax.

1. We already have std.typecons.Tuple.expand, which does the 
similar thing. If it is doable with a library solution, it could 
be Expand!(TypeTuple).

2. If not, the ... operator is a good choice here, but I would 
suggest making it prefix, and not postfix. First, it would nicely 
differenciate it from variadic operator. Second, it would be 
straightforward and consistent for those using Javascript as 
well, as ... is a spread operator there - `call(...[a, b, c])` is 
equivalent to `call(a, b, c)`.

Such a spread operator in D could work for TypeTuples, value 
tuples and static arrays. Simple, conscise and similar with what 
one of the most widely used languages does.


More information about the Digitalmars-d mailing list