Skip to content

Commit

Permalink
Merge #6
Browse files Browse the repository at this point in the history
6: Extend keys, values, and map r=charleskawczynski a=charleskawczynski



Co-authored-by: Charles Kawczynski <[email protected]>
  • Loading branch information
bors[bot] and charleskawczynski authored Mar 5, 2021
2 parents cb3aa0c + e8ab3c8 commit 89a26e7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "DispatchedTuples"
uuid = "508c55e1-51b4-41fd-a5ca-7eb0327d070d"
authors = ["Charles Kawczynski <[email protected]>"]
version = "0.1.1"
version = "0.1.2"

[compat]
julia = "1.5"
3 changes: 3 additions & 0 deletions src/DispatchedTuples.jl
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ end

Base.isempty(dt::AbstractDispatchedTuple) = Base.isempty(dt.tup)
Base.length(dt::AbstractDispatchedTuple) = Base.length(dt.tup)
Base.map(f, dt::AbstractDispatchedTuple) = Base.map(f, dt.tup)
Base.keys(dt::AbstractDispatchedTuple) = map(x->x[1], dt)
Base.values(dt::AbstractDispatchedTuple) = map(x->x[2], dt)

"""
DispatchedTupleSet(tup[, default_value])
Expand Down
3 changes: 3 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ end
dt = DispatchedTuple(tup)
@test length(dt) == length(tup)
@test isempty(dt) == isempty(tup)
@test map(x->x, dt) == map(x->x, dt.tup)
@test values(dt) == map(x->x[2], dt.tup)
@test keys(dt) == map(x->x[1], dt.tup)

tup = ()
dt = DispatchedTuple(tup)
Expand Down

2 comments on commit 89a26e7

@charleskawczynski
Copy link
Owner

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/31377

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.1.2 -m "<description of version>" 89a26e712f1e4a571532fe62458f2db4b3d3e037
git push origin v0.1.2

Please sign in to comment.