Maybe you could use keyword arguments Functions · The Julia Language
The differences to optional arguments is that the order doesn’t matter but only the keywords. Notices that one uses ; instead of , to capture keyword argument lists.
E.g.
function myfunction(input::AbstractMatrix,
preprocess::Function,
updater!::Function;
args...
)
A = preprocess(input; args...)
# Some common code
# [...]
for i in 1:100
# Some common code
# [...]
updater!(A; args...)
end
# Some common code
# [...]
return A
end
For the user calling your function it is enough to write
myfunction(input, preprocess, updater!, alpha = 10, beta = 4 )