Yes you can. Since a function is introducing a new constant in the current
namespace
you can access and list them in an array:
a(x) = x^2
b(x) = x^3
map((x) -> x(2), [a, b])
=> 2-element Array{Int64,1}:
4
8
4
8
(I expect people here to proclaim that higher order functions like map are
slow and raw loops shall be used instead.
I disagree and see no point why a higher order function has to be
necessarily slower. It's clear and concise syntax.)
But this has been discussed well enough and I stop right here.
You can use raw loops as well of course.
Hope this helps.
Stefan
On Monday, November 24, 2014 9:48:26 AM UTC+1, K leo wrote:
>
> I have a bunch of functions with same signature. I would like to invoke
> them one by one at run time. What is the best way of doing this? Can I
> put them all in an array or some other collection and loop through it at
> the run time?
>
>