Is previous function apply remove from base?

Oh, if I had known that was your actual concern I would have pointed out that there’s a function in Base.splat (soon to be exported as Splat in v1.9) that does this as a higher order function.

julia> Base.splat(+)((1,2,3,4))
10

That is, the old apply can be written as

apply(f, args) = Base.splat(f)(args)

To ease this, I’ve added a PR to Compat.jl to export Splat: add `Splat` by MasonProtter · Pull Request #785 · JuliaLang/Compat.jl · GitHub

3 Likes