-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Fix method signature format and clarify functional complements #6857
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
Updated according to issue #6790 to comply with official formatting standards
Specify that Take and Skip are complements when the sequences are unrepeatable
Docs Build status updates of commit 5ae431d: ✅ Validation status: passed
For more details, please refer to the build report. Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report. For any questions, please:
|
Docs Build status updates of commit 755dac4: ✅ Validation status: passed
For more details, please refer to the build report. Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report. For any questions, please:
|
@eiriktsarpalis @layomia can you review? |
@@ -9902,7 +9902,7 @@ Only unique elements are returned. | |||
|
|||
If `source` contains fewer than `count` elements, an empty <xref:System.Collections.Generic.IEnumerable%601> is returned. If `count` is less than or equal to zero, all elements of `source` are yielded. | |||
|
|||
The <xref:System.Linq.Enumerable.Take%2A> and <xref:System.Linq.Enumerable.Skip%2A> methods are functional complements. Given a sequence `coll` and an integer `n`, concatenating the results of `coll.Take(n)` and `coll.Skip(n)` yields the same sequence as `coll`. | |||
The <xref:System.Linq.Enumerable.Take%2A> and <xref:System.Linq.Enumerable.Skip%2A> methods are functional complements. Given an unrepeatable sequence `coll` and an integer `n`, concatenating the results of `coll.Take(n)` and `coll.Skip(n)` yields the same sequence as `coll`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand the meaning of the phrase "unrepeatable sequence". Could you clarify?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An unrepeating sequence; one who's items only are iterated over once in the iteration of the sequence as a whole.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one who's items only are iterated over once in the iteration of the sequence as a whole.
I see your point, but I think the purpose of this comment is to provide an illustration on the semantics of Take
and Skip
, rather than state a universal invariant. I don't think that the particular change adds clarity to the statement. How about something like "Given a collection sequence"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds better. I'm not able to edit this any more since I deleted the fork a week ago. Could you add in this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can't update this without the original fork. I've cloned this PR and made the change. Would you @steveberdy and @eiriktsarpalis like me to open a new PR with the change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't mind. Just mention this PR in your pull request so I can close it when yours gets merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@adegeo I'll submit another PR for GC.xml. I'm assuming your PR just has changes to Enumerable.xml?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll clone this PR so it will have all the changes. Is that OK?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
I'll close this in favor of #6883 |
Summary
Edits to GC.xml (issue #6790)
This fixes the space before the parentheses in the method signature, making it comply with official formatting rules.
Edits to Enumerable.xml (issue #5152)
These fixes add the slight detail that the
Take
andSkip
methods inSystem.Linq
are complements given first that the enumerable is not repeatable.Fixes #6790
Fixes #5152