If I want to pass the function that constructs an array of Any, given some
values, to another function, what do I use?
Here's an example that might make things clearer:
julia> f(x...) = Any[x...]
f (generic function with 1 method)
julia> apply(f, 1,2,3)
3-element Array{Any,1}:
1
2
3
julia> apply(Any[], 1,2,3)
ERROR: MethodError: `call` has no method matching call(::Array{Any,1}, ::
Int64, ::Int64, ::Int64)
Closest candidates are:
BoundsError(::Any...)
TypeVar(::Any...)
TypeConstructor(::Any...)
...
in apply at deprecated.jl:116
where I am looking for what the built-in equivalent of f() is.
I may be even more confused, because I also don't understand why this fails:
julia> call(f, 1, 2)
ERROR: MethodError: `call` has no method matching call(::Function, ::Int64,
::Int64)
Closest candidates are:
BoundsError(::Any...)
TypeVar(::Any...)
TypeConstructor(::Any...)
...
So any guidance appreciated.
Thanks,
Andrew