Skip to content

Commit

Permalink
Merge pull request #16613 from JuliaLang/jb/dep_bcast_fun
Browse files Browse the repository at this point in the history
deprecate `broadcast_function` and `broadcast!_function`
  • Loading branch information
tkelman committed May 28, 2016
2 parents 0c23131 + d658e75 commit 6591216
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 36 deletions.
5 changes: 1 addition & 4 deletions base/broadcast.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Broadcast
using ..Cartesian
using Base: promote_op, promote_eltype, promote_eltype_op, @get!, _msk_end, unsafe_bitgetindex
import Base: .+, .-, .*, ./, .\, .//, .==, .<, .!=, .<=, , .%, .<<, .>>, .^
export broadcast, broadcast!, broadcast_function, broadcast!_function, bitbroadcast
export broadcast, broadcast!, bitbroadcast
export broadcast_getindex, broadcast_setindex!

## Broadcasting utilities ##
Expand Down Expand Up @@ -221,9 +221,6 @@ broadcast(f, As...) = broadcast!(f, Array{promote_eltype_op(f, As...)}(broadcast

bitbroadcast(f, As...) = broadcast!(f, BitArray(broadcast_shape(As...)), As...)

broadcast!_function(f) = (B, As...) -> broadcast!(f, B, As...)
broadcast_function(f) = (As...) -> broadcast(f, As...)

broadcast_getindex(src::AbstractArray, I::AbstractArray...) = broadcast_getindex!(Array{eltype(src)}(broadcast_shape(I...)), src, I...)
@generated function broadcast_getindex!(dest::AbstractArray, src::AbstractArray, I::AbstractArray...)
N = length(I)
Expand Down
3 changes: 3 additions & 0 deletions base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1273,6 +1273,9 @@ end
@deprecate print_unescaped unescape_string
@deprecate print_joined join

@deprecate broadcast!_function(f) (B, As...) -> broadcast!(f, B, As...)
@deprecate broadcast_function(f) (As...) -> broadcast(f, As...)

##### histogram #####

## nice-valued ranges for histograms
Expand Down
18 changes: 0 additions & 18 deletions base/docs/helpdb/Base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3482,15 +3482,6 @@ not representable.
"""
trunc

"""
broadcast_function(f)
Returns a function `broadcast_f` such that
`broadcast_function(f)(As...) === broadcast(f, As...)`. Most useful in the form
`const broadcast_f = broadcast_function(f)`.
"""
broadcast_function

"""
unsafe_convert(T,x)
Expand Down Expand Up @@ -5625,15 +5616,6 @@ information.
"""
code_warntype

"""
```
broadcast!_function(f)
```
Like `broadcast_function`, but for `broadcast!`.
"""
broadcast!_function

"""
setrounding(T, mode)
Expand Down
2 changes: 0 additions & 2 deletions base/exports.jl
Original file line number Diff line number Diff line change
Expand Up @@ -486,9 +486,7 @@ export
# arrays
bitbroadcast,
broadcast!,
broadcast!_function,
broadcast,
broadcast_function,
broadcast_getindex,
broadcast_setindex!,
cat,
Expand Down
12 changes: 0 additions & 12 deletions doc/stdlib/arrays.rst
Original file line number Diff line number Diff line change
Expand Up @@ -316,18 +316,6 @@ All mathematical operations and functions are supported for arrays
Like ``broadcast``\ , but allocates a ``BitArray`` to store the result, rather then an ``Array``\ .

.. function:: broadcast_function(f)

.. Docstring generated from Julia source
Returns a function ``broadcast_f`` such that ``broadcast_function(f)(As...) === broadcast(f, As...)``\ . Most useful in the form ``const broadcast_f = broadcast_function(f)``\ .

.. function:: broadcast!_function(f)

.. Docstring generated from Julia source
Like ``broadcast_function``\ , but for ``broadcast!``\ .

Indexing, Assignment, and Concatenation
---------------------------------------

Expand Down

0 comments on commit 6591216

Please sign in to comment.