@opera_malenky are you really sure you need this? I think that your very first idea:
a(x) = [minimum(x), maximum(x), median(x)]
is just fine. I think about it this way:
Let’s say a new user wants the maximum and minimum of their data. In the simple implementation, they have to know the name of the functions “maximum” and “minimum”, and they compute their statistics with:
mydata = [maximum(x), minimum(x)]
in the fivenum world, the user doesn’t have to know the function names, but they still have to know the names of the statistics (which are, actually, just the names of functions) plus they have to know how fivenum works (which isn’t something they will have encountered anywhere else in Julia) in order to do:
mydata = fiivenum(x, ["maximum", "minimum"])
which doesn’t actually save them from remembering anything at all. Plus, it requires you to create this complicated implementation and maintain it forever.
In essence, what you’re doing is creating a very very very simple programming language inside of Julia, in which users can pass a vector of function names and get a vector of results. But Julia’s already a pretty good language, so you might be better off just letting your users use Julia!
Also, your last example looks like the beginnings of an implementation of broadcasting. Fortunately, Julia has broadcasting built-in, and it’s amazing. For example, to do f(x, y) for each x in [1, 2, 3] and y = 5, you just define the scalar function:
f(x, y) = x + y
and call it with an extra dot:
f.([1, 2, 3], 5)