I'm developing a package in Julia, and in my package I have several functions that have the same layout, but some small variations in terms of the parameters they use. For example:
function MyFunction1(arg1, arg2)
do(arg1,arg2,parameter1)
end
function MyFunction2(arg1, arg2)
do(arg1,arg2,parameter2)
end
function MyFunction3(arg1, arg2)
do(arg1,arg2,parameter3)
end
Now, what I'd like to do was creating one specification array, where I pass the functions names and the parameters, and use metaprogramming to define this functions, for example:
spec = [["MyFunction1","parameter1"],["MyFunction2","parameter2"],["MyFunction3","parameter3"]]
How can one do this in Julia? Note that this is a simplified example, and I actually want to allow for more complex variation, otherwise it would be wiser to just create one function with the additional parameters instead of creating several functions.