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
Sometimes we use “returns”, other times we use “-->” to indicate return type #1024
Comments
|
I vote for "returns.". To me it looks cleaner, and I suspect it's more self-explanatory and less confusing for inexperienced Perl Sixers. |
|
Judging by (my branch is pretty old, but I don't think there will be much difference with up-to-date) the second way is much more used, so it will be easier to shift to this one. Seems like a quite easy grep-emacs-macro-job(and there are not so many lines to review, only about 50+), so I can do it tomorrow or the day after tomorrow if nobody is against. |
|
If we're going to enforce this style, we'll need a test for it. Otherwise it'll creep back in later. |
|
If the test can be simple, something like https://github.com/perl6/doc/blob/master/t/tabs.t, then it is not so hard to actually write one, just check for |
|
Accordingly to https://irclog.perlgeek.de/perl6/2016-12-03#i_13673364 the current state of the issue is: With this in mind, I'm not sure we need some radical changes in this area, to be honest. Of course, we can change all signatures to And I don't think it is a big problem, since https://docs.perl6.org/type/Signature#Constraining_Return_Types has a quite proper explanation of all ways to express return type. However, it will be great to expand this section with a notice about the difference between styles above. |
|
@Altai-man that's a good idea I think. |
|
It will make it harder to write a test for it though :) |
|
The situation with a test is:
With all that in mind, our current plan can be like this:
|
|
@Altai-man what about the rest? I think the stuff in |
|
See this for discussion: https://irclog.perlgeek.de/perl6/2016-12-03#i_13674580 The pull request for converting Basically, the only reason to choose |
|
The reverse PR is on its way... |
This commit affects all signatures that exist in the type documentation: it replaces "returns " occurences with "-->" form. See #1024 (comment) for explanations.
|
Closed with #1035 merge. |
|
|
I think we can be a bit more consistent. Perhaps “returns” is better because it is more readable, but I don't mind as long as it is consistent.
The text was updated successfully, but these errors were encountered: