-
-
Notifications
You must be signed in to change notification settings - Fork 746
Add explicit return types in std.regex #5963
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
Conversation
|
Thanks for your pull request, @dhasenan! We are looking forward to reviewing it, and you should be hearing from a maintainer soon. Some tips to help speed things up:
Bear in mind that large or tricky changes may require multiple rounds of review and revision. Please see CONTRIBUTING.md for more information. Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. |
Quite the contrary, because it's Thanks for the PR but I'm going to close this because this is churn which has little benefit and restricts us in the future. If you find the documentation lacking, please bug/PR it. |
|
The types are owned by std.regex; they aren't shared with other modules. They have no other purpose. So we can alter them however we wish without having to rename them. If we needed to switch to a different return type that is shared by another module, it is easy to add an alias. Finally, the argument that we can alter return types at any time if they're listed as |
|
Even worse, such an explicit return type makes function signature looks ugly and any changes to it force us to modify it. |
|
@dhasenan thanks a lot for your pull request and wanting to make Phobos a better library. However, I think you should put your energy in something new or real bugs instead.
+1 (and I also think that
No we wouldn't be able to:
If people really need the return type, it's as simple as
Nothing, but development is happening and why should we restrict ourselves without need? |
As per the discussion at dlang#5963, we want the option to swap out the types for Regex, Capture, etc. This is impossible if people are able to refer to Regex by name. Furthermore, according to @wilzbach, aliases are not an option. Therefore, this PR deprecates the public Regex alias, to allow us to switch out the concrete type later.
As per the discussion at dlang#5963, we want the option to swap out the types for Regex, Capture, etc. This is impossible if people are able to refer to Regex by name. Furthermore, according to @wilzbach, aliases are not an option. Therefore, this PR deprecates public uses of the Regex types to allow us to switch out the concrete type later.
https://issues.dlang.org/show_bug.cgi?id=18124 : explicit return types are good for documentation. Mildly annoying for editing when you are breaking the public API, but that shouldn't happen, right?