Why not filt, filter as filter?

julia> methods(filter)
# 8 methods for generic function "filter":
filter(f, a::Array{T,1} where T) in Base at array.jl:1841
filter(f, Bs::BitArray) in Base at bitarray.jl:1911
filter(f, As::AbstractArray) in Base at array.jl:1819
filter(f, d::Associative) in Base at associative.jl:312
filter(f, s::Set) in Base at set.jl:229
filter(f, s::AbstractString) in Base at strings/basic.jl:462
filter(p, x::Nullable{T}) where T in Base at nullable.jl:257
filter(flt, itr) in Base at deprecated.jl:56

julia> methods(filt)
# 2 methods for generic function "filt":
filt(b::Union{AbstractArray{T,1} where T, Number}, a::Union{AbstractArray{T,1} where T, Number}, x::AbstractArray{T,N} where N) where T in Base.DSP at dsp.jl:19
filt(b::Union{AbstractArray{T,1} where T, Number}, a::Union{AbstractArray{T,1} where T, Number}, x::AbstractArray{T,N} where N, si::AbstractArray{S,N} where N) where {T, S} in Base.DSP at dsp.jl:19

julia> 

Is there any particular reason why these two functions are not one?

1 Like

This is probably because they do very different things, so it may be confusing to overload the same function.

DSP does note exist in Base anymore. Edit: It does, moved out for 0.7.

2 Likes

The most disambiguating method should always be defined first in the function, and because they do very different things, confusion is null?

Did you read that here somewhere? I couldn’t find it.

https://github.com/JuliaLang/julia/pull/21956

1 Like