The following seems to work pretty well for the problem as youβve posed it:

```
julia> function run(names::Vector{Symbol})
library = Dict(
:f1 => x -> minimum(x),
:f2 => x -> maximum(x),
:f3 => x -> sum(x)
)
functions_to_call = Tuple([library[s] for s in names])
return function (x)
call.(functions_to_call, Ref(x))
end
end
run (generic function with 1 method)
julia> call(f, x) = f(x)
call (generic function with 1 method)
julia> f = run([:f1, :f2])
#38 (generic function with 1 method)
julia> f([1,2,3])
(1, 3)
```

Some notes:

- Iβm assembling a Dict mapping names to functions, rather than trying to look them up by the names of the variables theyβre bound to. I wouldnβt recommend trying to access things inside some other function by their variable names: variable names donβt really exist in the compiled code, so looking things up by variable name isnβt a great idea.
- I construct a
`Tuple`

of functions to call instead of just a list so that Julia can correctly infer the number of outputs of the resulting function (a tupleβs length is part of its *type*, which is not true for an Array). That means that Julia can correctly infer the output type of `f()`

in the above example:

```
julia> @code_warntype f([1,2,3])
Body::Tuple{Int64,Int64}
9 1 β %1 = %new(Base.RefValue{Array{Int64,1}}, x)::Base.RefValue{Array{Int64,1}} ββ»β·β· Type
β %2 = (Base.getfield)(%1, :x)::Array{Int64,1} βββ»β·β·β·β·β·β·β·β·β· copy
β %3 = Base.identity::typeof(identity) ββββ»β·β·β·β·β· tuplebroadcast
β %4 = Base.min::typeof(min) ββββββββββββββ ntuple
β %5 = invoke Base._mapreduce(%3::typeof(identity), %4::typeof(min), $(QuoteNode(IndexLinear()))::IndexLinear, %2::Array{Int64,1})::Int64
β %6 = (Base.getfield)(%1, :x)::Array{Int64,1} βββββββ»β·β·β·β·β· _broadcast_getindex
β %7 = Base.identity::typeof(identity) ββββββββ»β·β·β·β·β· _broadcast_getindex_evalf
β %8 = Base.max::typeof(max) ββββββββββββββ call
β %9 = invoke Base._mapreduce(%7::typeof(identity), %8::typeof(max), $(QuoteNode(IndexLinear()))::IndexLinear, %6::Array{Int64,1})::Int64
β %10 = (Core.tuple)(%5, %9)::Tuple{Int64,Int64} βββββ
βββ return %10
```

and that in turn means that you should be able to use the resulting `f`

efficiently:

```
julia> using BenchmarkTools
julia> @btime $f($([1,2,3]))
7.089 ns (0 allocations: 0 bytes)
(1, 3)
```