Internals

BangBang.__append!!__Function
__append!!__(dest::CustomType, src) -> dest′

This is an overload interface for append!!. This function must dispatch on the first argument and implemented by the owner of the type of the first argument.

source
BangBang.__appendto!!__Function
__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!!__ is found.

source
BangBang.implementsFunction
implements(f!, x) :: Bool

true if in-place function f! can mutate x.

Examples

julia> using BangBang: implements

julia> implements(push!, Vector)
true

julia> implements(push!, [])  # works with instances, too
true

julia> implements(push!, Tuple)
false

julia> using StaticArrays

julia> implements(push!, SVector)
false

julia> implements(setindex!, SVector)
false

julia> implements(push!, MVector)
false

julia> implements(setindex!, MVector)
true
source
BangBang.mayFunction
may(mutate!, args...)

Call mutate!(args...) if possible; fallback to the out-of-place version if not.

source
BangBang.possibleFunction
possible(f!, args...) :: Bool

Check if f!(args...) is possible.

Examples

julia> using BangBang: possible

julia> possible(push!, Int[], 1)
true

julia> possible(push!, Int[], 0.5)
false
source