This is solved with a closure. If you have a function f(x,p)
where p
is a parameter you can easily create a new function f2(x) = f2(x, p)
which “closes over” p
. See Documentation - Stack Overflow, https://docs.julialang.org/en/stable/devdocs/functions/#closures.
3 Likes