Skip to content

Commit

Permalink
Add __appendto!!__ (#175)
Browse files Browse the repository at this point in the history
  • Loading branch information
tkf committed Jul 2, 2020
1 parent d2d83d2 commit 03f33ff
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,18 @@ dispatch on the first argument and implemented by the owner of the
type of the first argument.
"""
__append!!__
@inline __append!!__(xs, ys) = may(_append!, xs, ys)
@inline __append!!__(xs, ys) = __appendto!!__(xs, ys)

"""
__appendto!!__(dest, src::CustomType) -> dest′
This is an overload interface for `append!!`. This function must
dispatch on the second argument and implemented by the owner of the
type of second first argument. This function is used when there is
no specific implementation for [`__append!!__`](@ref) is found.
"""
__appendto!!__
@inline __appendto!!__(xs, ys) = may(_append!, xs, ys)

# An indirection for supporting dispatch on the second argument.
_append!(dest, src) = append!(dest, src)
Expand Down

0 comments on commit 03f33ff

Please sign in to comment.