Using a lambda works:
julia> funs = [sin,cos,tan]
3-element Array{Function,1}:
sin
cos
tan
julia> vals = rand(3)
3-element Array{Float64,1}:
0.889165
0.64722
0.997409
julia> map((f,x)->f(x), funs, vals)
3-element Array{Float64,1}:
0.776546
0.797763
1.54857
On Mon, Feb 22, 2016 at 4:22 PM, Erik Schnetter <[email protected]> wrote:
> I have an array of functions (`funs`) and an array of values (`vals`).
> I want to apply the former to the latter, element-wise. When I write
>
> ```Julia
> map(call, funs, vals)
> ```
> Julia replies with
> ```
> WARNING: call(f,args...) is deprecated, use f(args...) instead.
> ```
>
> What is the correct syntax to use?
>
> -erik
>
> --
> Erik Schnetter <[email protected]>
> http://www.perimeterinstitute.ca/personal/eschnetter/
>