Skip to content
This repository has been archived by the owner on May 4, 2019. It is now read-only.

Commit

Permalink
Small naming improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
nalimilan committed Dec 4, 2016
1 parent b6c675f commit 89336d1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/broadcast.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ else
using Base.Broadcast: ziptype
end

call_broadcast{F, N}(f::F, dest, As::Vararg{NullableArray, N}) =
invoke_broadcast!{F, N}(f::F, dest, As::Vararg{NullableArray, N}) =
invoke(broadcast!, Tuple{Function, AbstractArray, Vararg{AbstractArray, N}}, f, dest, As...)

"""
Expand Down Expand Up @@ -63,7 +63,7 @@ function Base.broadcast{F, N}(f::F, As::Vararg{NullableArray, N})
else
dest = similar(NullableArray{eltype(T)}, broadcast_indices(As...))
end
call_broadcast(f2, dest, As...)
invoke_broadcast!(f2, dest, As...)
end

"""
Expand All @@ -88,13 +88,13 @@ function Base.broadcast!{F, N}(f::F, dest::NullableArray, As::Vararg{NullableArr
f2(x1, x2, x3, x4, x5, x6) = lift(f, x1, x2, x3, x4, x5, x6)
f2(x1, x2, x3, x4, x5, x6, x7) = lift(f, x1, x2, x3, x4, x5, x6, x7)
f2(x...) = lift(f, x...)
call_broadcast(f2, dest, As...)
invoke_broadcast!(f2, dest, As...)
end

# To fix ambiguity
function Base.broadcast!{F}(f::F, dest::NullableArray)
f2() = lift(f)
call_broadcast(f2, dest)
invoke_broadcast!(f2, dest)
end

# broadcasted ops
Expand Down
8 changes: 4 additions & 4 deletions src/map.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Base: collect_similar, Generator

call_map{F, N}(f::F, dest, As::Vararg{NullableArray, N}) =
invoke_map!{F, N}(f::F, dest, As::Vararg{NullableArray, N}) =
invoke(map!, Tuple{Function, AbstractArray, Vararg{AbstractArray, N}}, f, dest, As...)

"""
Expand Down Expand Up @@ -32,7 +32,7 @@ function Base.map{F, N}(f::F, As::Vararg{NullableArray, N})
else
dest = similar(NullableArray{eltype(T)}, size(As[1]))
end
call_map(f2, dest, As...)
invoke_map!(f2, dest, As...)
end

"""
Expand All @@ -57,11 +57,11 @@ function Base.map!{F, N}(f::F, dest::NullableArray, As::Vararg{NullableArray, N}
f2(x1, x2, x3, x4, x5, x6) = lift(f, x1, x2, x3, x4, x5, x6)
f2(x1, x2, x3, x4, x5, x6, x7) = lift(f, x1, x2, x3, x4, x5, x6, x7)
f2(x...) = lift(f, x...)
call_map(f2, dest, As...)
invoke_map!(f2, dest, As...)
end

# This definition is needed to avoid dispatch loops going back to the above one
function Base.map!{F}(f::F, dest::NullableArray)
f2(x1) = lift(f, x1)
call_map(f2, dest, dest)
invoke_map!(f2, dest, dest)
end

0 comments on commit 89336d1

Please sign in to comment.