Skip to content
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

fix identity map #470

Merged
merged 4 commits into from
Dec 28, 2018
Merged

fix identity map #470

merged 4 commits into from
Dec 28, 2018

Conversation

Roger-luo
Copy link
Contributor

MWE: when there is a LinkedList{Any}, the following will error:

ex = :(a+b+2 * 2 + foo(2))
tl = list(ex.args...)
map(x->x, tl)

This PR will fix it, and will allow more generic (each node has different generic types) linked list.

@codecov
Copy link

codecov bot commented Dec 20, 2018

Codecov Report

Merging #470 into master will decrease coverage by 31.28%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master     #470       +/-   ##
===========================================
- Coverage    98.8%   67.52%   -31.29%     
===========================================
  Files          27       28        +1     
  Lines        1336     2069      +733     
===========================================
+ Hits         1320     1397       +77     
- Misses         16      672      +656
Impacted Files Coverage Δ
src/list.jl 93.84% <100%> (-6.16%) ⬇️
src/container_loops.jl 35.1% <0%> (-64.9%) ⬇️
src/balanced_tree.jl 45.08% <0%> (-54.92%) ⬇️
src/delegate.jl 50% <0%> (-50%) ⬇️
src/dict_support.jl 50% <0%> (-50%) ⬇️
src/heaps/mutable_binary_heap.jl 50% <0%> (-50%) ⬇️
src/deque.jl 57.35% <0%> (-42.65%) ⬇️
src/tokens2.jl 64.1% <0%> (-35.9%) ⬇️
src/sorted_set.jl 65.24% <0%> (-34.76%) ⬇️
src/heaps/binary_heap.jl 68.25% <0%> (-31.75%) ⬇️
... and 16 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 31044ef...3d9e34e. Read the comment docs.

@@ -103,4 +103,10 @@
@test collect(l10) == [2; 4; 5.6; 10.5]
end

@testset "l11" begin
Copy link
Member

@oxinabox oxinabox Dec 21, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please give this @testset a real name.

The fact that the existing testsets do not have real names is not a convention of this package.
It is a flaw resulting from the package being older than testsets.
And noone having gotten around to renaming things with meaninful names yet

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Fixed.

Copy link
Member

@oxinabox oxinabox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually spent a while thinking about this.
I concluded that it will do.
There is probably something smarter we can
do but this is definitely an improvement.

If you can fix the testset name we can merge

@Roger-luo
Copy link
Contributor Author

Roger-luo commented Dec 27, 2018

Yeah, I was thinking to have a more elegant solution for this, e.g keep the interface, but implement several different types (for different situation), like mutable, immutable, etc.

But this is just a straight forward fix to make things work first.

@oxinabox oxinabox merged commit 26e0229 into JuliaCollections:master Dec 28, 2018
@oxinabox
Copy link
Member

Something like what @andyferris did here for determining and progressively widening the type
seems smartest.
JuliaLang/julia#30286

(I just have that PR handly for unique handy, there is something like that for Base.map(f, ::Array) I am sure.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants