-
-
Notifications
You must be signed in to change notification settings - Fork 608
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
Add algorithms: filter, map and equals #11643
Conversation
Thanks for your pull request and interest in making D better, @jacob-carlborg! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. 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. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + dmd#11643" |
01b076d
to
aaf52f0
Compare
} | ||
|
||
alias opDollar = length; | ||
} |
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 would add opSlice
overloads, s.t. the ranges can be saved/copied (I see that you have already used this for built-in arrays)
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 looks like it's going to be a bit more complicated. As in quite a bit of extra code need to be added. I had to draw the line somewhere to minimize the code that needed to be added.
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.
Fair enough, we can always add it when needed.
0ebe3d5
to
295ba68
Compare
Win32 on the auto-tester times out every time. The failing test in buildkite for pbackus/sumtype seems unrelated. |
Buildkite should be unbroken by dlang/phobos#7611. I don't know what's the story with win32. |
295ba68
to
aff57d4
Compare
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.
Great start 👍
I think this is a great start. Any other objections / opinions? |
Also adds function to create static arrays.
aff57d4
to
bb69478
Compare
Yes sorry I object. This PR needs a second commit that does refactoring using the new functions. You see just at a few places. |
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.
prove it is required in a second commit
well "required" is not what I mean. what i mean is more like "these abstractions make the code more pleasant to read and easy to understand". |
We're talking about the "heart of Phobos" here. There's really no need to show why lazy, non-allocating filter and map are useful for writing maintainable code. We have been talking on and off about introducing it to DMD for years. |
Why not start using it directly in dmd ? as far as i understand the example is in the fork modified for visual-d. |
Because as a good citizen I split up my changes into multiple PRs to make them more manageable. 9 of my last 10 merged PRs have been all refactorings and preparations for adding support for Objective-C protocols. This one is that as well. If you insist, I know of an existing place that could benefit, but that would require
No, it definitely is not. I don't work at or use visual-d at all. If you haven't noticed, I use Mac 😉. |
Indeed and sorry. Rainers S does, not you. |
No worries 😃. |
Thanks. |
Also adds function to create static arrays.
Supersedes #11586.