How to apply one argument to Array{Function, 1} element-wise smartly in Julia?

Viewed 603

I understand Julia can apply element-wise argument to a function by f.(x) in v0.6

x = [1, 2, 3]
f = x->3x
@assert f.(x) = [3, 6, 9]

Now, I define f as Array{Function, 1}.

f1(x) = 3x
f2(x) = 4x
f = [f1,  f2]
x = 2
@assert isa(f,  Array{Function,1}) == true
# f.(x) is unavailable

I want to apply arguments to element-wise function like above syntax, not using map, [_f(x) for _f in f]

Can someone be familiar with this issue?

3 Answers
Related