walkBack follow-up: Mention fold's potential in the examples#5227
Merged
wilzbach merged 1 commit intodlang:masterfrom Mar 2, 2017
Merged
walkBack follow-up: Mention fold's potential in the examples#5227wilzbach merged 1 commit intodlang:masterfrom
wilzbach merged 1 commit intodlang:masterfrom
Conversation
andralex
approved these changes
Mar 2, 2017
Member
andralex
left a comment
There was a problem hiding this comment.
You don't waste time do you :)
std/algorithm/iteration.d
Outdated
| // Can be used in a UFCS chain | ||
| assert(arr.map!(a => a + 1).fold!((a, b) => a + b) == 20); | ||
|
|
||
| // Return the last element of any range (walkBack) |
Member
There was a problem hiding this comment.
walkBack will not be clear without context, you may want to remove it
Contributor
Author
Ok fair enough -> removed.
Such "improvements ideas" tend to get easily forgotten, so it's either now or never ;-) |
Contributor
Author
|
Auto-merge toggled on |
Member
|
@wilzbach ask and ye shall receive: https://issues.dlang.org/show_bug.cgi?id=17238 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hmm we don't have many tests based on files and they usually are a bit clunky as one needs to write the file first.
So I simply added the "
walkBackusage" to the existing unittests offold.However, I am happy to add a file example as well if you know a good spot ;-)