New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix issue 9591 - Allow Instantiate template to be public #5739
Conversation
of how Instantiate + ApplyRight can be used to solve the problem.
ping @wilzbach I simply reused my branch and opened a new PR, but dlang-bot didn't notice? |
Don't worry about it. The essential things are run in a loop and run every five minutes. It's probably an issue with the GitHub API, but I am currently on the way for a week long vacation, so I sadly can't check the logs to be sure. Thanks for the ping! |
Thanks for your pull request, @schveiguy! Bugzilla references
|
Ah, @wilzbach it's because I squashed the original branch, so must be dlang-bot didn't think there were changes (or github didn't notify?). Anyway, seems good now, I had to fix the docs a bit and the bot showed up. |
Shouldn't this have been formally approved by @andralex? (after all it's a "new" public symbol) |
@wilzbach Good question. I'm new around these parts. |
It's newly public, but not new. I don't speak for Andrei, but I think the naming of the symbol is correct -- I can't imagine a better name is possible. But the question to answer is, does this solve a big enough problem such that it's worthy of a new symbol? Given the problem it solves in the context of |
I'm not thrilled about this. A compelling example should be found, if not I think we shouldn't add this kind of subtle artifacts of very limited usefulness. |
This is as essential as
I can't think of a more compelling example besides trying to apply a bunch of similar templates to the same parameters. All you have to do is look at all the simple templates in this file to see things that are easy to declare, but are needed many places, so this module collects them. Also note that |
@schveiguy what would a good standalone example not necessitating much additional information? |
@andralex: It crops up all over the place in "higher-order template" code, see e.g. Yes, it is a trivial artefact. But if a typical user encounters the problem, they would find the solution somewhat non-obvious. Hence, I'd contend that it is useful for this to be discussed in the |
Thanks for the due diligence @klickverbot! |
(In an ideal world, I'd prefer fixing that grammar limitation and adding an inline template "lambda" syntax to this, though.) |
Template lambdas would be awesome. The more you do template metaprogramming, the more painful it seems that they aren't there. I have no idea what a reasonable syntax for them would be though, which is part of why I've never really tried to push the idea. |
This is missing a changelog entry. |
This solves the problem in the referenced issue. I've added the solution as a documented unit test for
Instantiate
.