Skip to content

Commit

Permalink
generalize filter[!] docstring and add compat annotation for Tuple (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
rfourquet authored Apr 21, 2020
1 parent 0747766 commit ad87100
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions base/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2363,11 +2363,14 @@ end
## Filter ##

"""
filter(f, a::AbstractArray)
filter(f, a)
Return a copy of `a`, removing elements for which `f` is `false`.
Return a copy of collection `a`, removing elements for which `f` is `false`.
The function `f` is passed one argument.
!!! compat "Julia 1.4"
Support for `a` as a tuple requires at least Julia 1.4.
# Examples
```jldoctest
julia> a = 1:10
Expand Down Expand Up @@ -2412,9 +2415,9 @@ function filter(f, a::AbstractArray)
end

"""
filter!(f, a::AbstractVector)
filter!(f, a)
Update `a`, removing elements for which `f` is `false`.
Update collection `a`, removing elements for which `f` is `false`.
The function `f` is passed one argument.
# Examples
Expand Down

0 comments on commit ad87100

Please sign in to comment.