-
Notifications
You must be signed in to change notification settings - Fork 254
Add MutableLinkedList #450
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
Codecov Report
@@ Coverage Diff @@
## master #450 +/- ##
=========================================
- Coverage 91.32% 90.73% -0.6%
=========================================
Files 29 30 +1
Lines 2133 2255 +122
=========================================
+ Hits 1948 2046 +98
- Misses 185 209 +24
Continue to review full report at Codecov.
|
Thanks for doing this. @ararslan, @kmsquire I am really busy right now. Generally, speaking I am kinda opposed to adding more DataStructures to Data Structures.jl. But with that said, #310 is a fair bit of work and I've failed at it once, and don't see myself having free time to run with it anytime soon. |
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 think this is a good home for a mutable linked list type until the package is split up as Lyndon noted, if that ever fully happens. I just have a few comments.
This is looking good to me, though it'd be nice to have another set of eyes on it as well. |
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.
Overall, looks good to me. I think it would be nice to bring the other LinkedList
up-to-date and make the interface look more like this one. But that doesn't have to happen with this PR.
Nice implementation! I think that's fine. I'm curious if there's a type
instability in there common case where the function return type doesn't
change?
|
Thanks 😄 Unfortunately, it looks like there is (I forgot to check). julia> @code_warntype map(f, l)
Body::MutableLinkedList{_1} where _1
.
.
.
5 ── . . .
│ %9 = (Core.Compiler.return_type)(f, %8)::Type
│ %10 = (Core.apply_type)(DataStructures.MutableLinkedList, %9)::Type{MutableLinkedList{_1}} where _1
│ %11 = (%10)()::MutableLinkedList{_1} where _1
.
.
. Not sure what the best way to fix it is though. Is there a recommended approach? |
Not that I'm aware of. In this case I think we just live with it. Thanks for the contribution! |
I put this together in response to issue #443. This is my first real contribution julia, so feel free to share any advice and/or feedback about how I could improve this implementation.