introduce "toTypeTuple"#1472
introduce "toTypeTuple"#1472monarchdodra wants to merge 3 commits intodlang:masterfrom monarchdodra:toTypeTuple
Conversation
|
Again: expression tuple, not type tuple. |
The result is a |
|
The names in Phobos are confusing and all my attempts to change the situation failed. So, please just remember this:
Stuff returning
|
|
@jmdavis, looks like you are confused too (the explonation was originally for @monarchdodra). |
|
A bit of history: |
|
The result of |
|
Are you talking about the developers? Because the users will read dlang.org's Tuples article and will see the terms I'm talking about. |
|
I hope this will become useless as soon we have a "static foreach": See also kind of the opposite: |
|
The fact that that article has is horrendous. |
|
very nice :) It's a pity about the tuple naming, but as Jonathan says, we're stuck with it. Any reason not to merge this ASAP? (The auto-tester failures are network problems and some strange makefile thing that only happened once :/ it appears to have passed every test at least once) |
|
@John-Colvin, are we continuing a bad comedy? I see no answer, who is stuck with Unless you give me a mark "you are to stupid to be here, dear Denis", I will continue this topic because I was such newcomer. And I was unpleasantly surprised by the amount of time I had to waste just to understand the terminology (i.e. current confusing situation with tuples). Then I suggested to fix the situation and made a pull. And I was unpleasantly surprised again when it with was rejected and no other solution was suggested. Now I'm surprised the third time by "sombody is stuck with |
|
Hmm. Perhaps you've got a point. See here for my take on it: http://forum.dlang.org/post/jagyupxiicevxrpnqewq@forum.dlang.org |
|
Is |
It's in
I really wish Andrei and/or Walter would follow through with the renaming of type tuples. It has a really damaging effect for learners of the language. |
|
Dicebot is working on a revamp of typetuple. |
I'm pretty sure that's orthogonal to the existing concept of type tuples, which are the ones we really need to rename. |
|
I think that's exactly what he's working on. In particular his upcoming DIP will rename TypeTuple to TemplateArgumentList. |
|
I don't think the renaming needs to wait for an implementation of non-expanding type tuples, which I thought was the bulk of his proposal. Pinging @Dicebot. If "template argument list" and "TemplateArgumentList" are the officially sanctioned new names, we should go ahead with the rename ASAP (renaming of symbols, deprecations, updating dlang.org). I am worried about that particular name though - it doesn't seem to accommodate the equivalents of "expression tuple" and "type tuple", which is an important distinction. |
|
@JakobOvrum It does not need to wait but separating those makes deprecation / transition process ~twice longer and complicated. I have been busy since we came to some agreement in a mail conversation with @andralex but DIP to destroy will be out by Sunday.
It is intentional as there is no strict distinction for it in language itself despite common confusion. Those are more use-case concepts than language / library concepts. |
No, it is an important language concept, as type tuples can be used to declare expression tuples. That is the distinction. |
I don't see how that could be the case. AFAICS, non-expanding tuples in the library are completely irrelvant to the current type tuples in the language. |
|
@JakobOvrum Rationalization is part of DIP. To put it shortly - we can't afford confusion of having both expanding and non-expanding library types. Former can be trivially got from latter via |
|
For what it's worth, I have no problems waiting for the DIP. I have no real position on the matter, so I can just rename this to anything you'd want me to. |
|
It sounds like I'll strongly dislike the proposal, but I guess I'll wait for the details to be posted. |
|
Closing until we decide where to go with TTs. |
|
Forgot to click "Close" ;) |
|
Link to DIP discussion thread for book-keeping - http://forum.dlang.org/post/ggxgongvmrdfajtbphis@forum.dlang.org |
|
Can this be updated and reopened? |
|
Yes. Could you update me on what needs to be done though? I've been out of the loop on recent events. |
|
This would be a great solution for the lack of a properly exposed |
|
scratch that, I guess it was already implemented as |
As suggested by @klickverbot in #1440, this pull supersedes
staticIotaby introducing a function that can transform any range a type tuple, including... iota.In terms of performance, I guess it runs pretty fast. Compared to my hand written
staticIota,toTypeTuple!iota, for a non release build, they both take the same ammount of time foriota(0, 1000), which is more than enough (IMO). That said, for larger sizes (eg 5000), toTypeTuple's performance does deteriorate. But at this point, the sizes are crazy huge in terms of static size...In a release build, they both take longer, but are still comparable (however, they do a wall which ices the compiler after a certain size.)
I did not add constraints, because I was unsure if it was OK to import
std.rangeinstd.typetuple, as it imports very very little.Pinging @denis-sh who might be interested.
All feedback welcome.