Skip to content

Commit

Permalink
Support Sets by implementing hash (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
dlfivefifty authored Feb 4, 2021
1 parent 667656f commit 897b7a0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "InfiniteArrays"
uuid = "4858937d-0d70-526a-a4dd-2d5cb5dd786c"
version = "0.9.2"
version = "0.9.3"

[deps]
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
Expand Down
5 changes: 4 additions & 1 deletion src/Infinity.jl
Original file line number Diff line number Diff line change
Expand Up @@ -375,4 +375,7 @@ Base.Checked.checked_add(::Integer, x::SignedInfinity) = x
Base.Checked.checked_add(x::SignedInfinity, ::Integer) = x


Base.to_index(::Infinity) =
Base.to_index(::Infinity) =


Base.hash(::Infinity) = 0x020113134b21797f # made up
7 changes: 7 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1025,3 +1025,10 @@ end
AbstractArray{Float64}(transpose(1:∞)) AbstractArray{Float64}(transpose(Base.OneTo(∞)))
transpose(InfUnitRange(1.0))
end

@testset "Set" begin
s = Set([∞,1])
@test 1 in s
@testin s
@test 2 s
end

2 comments on commit 897b7a0

@dlfivefifty
Copy link
Member Author

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/29331

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.9.3 -m "<description of version>" 897b7a0a34c2c64b66e82af463a3d10f868dc1e4
git push origin v0.9.3

Please sign in to comment.