Then that’s not a closure at all, it’s not capturing a local variable (capturing meaning that the local variable can live on despite the local scope ending) but accessing a global variable that persists unconditionally.
g still accesses the global param here, and f just takes a local param as an input.
const g = let p=param
g1(x) = f(p, x)
end
This puts a closure in a local scope that captures a local variable, and the returned closure is assigned to a const global variable.
If you don’t want to deal with scoping, you could also make a struct to hold values for callable instances:
struct G{P}<:Function p::P end
(_g::G)(x) = f(_g.p, x)
const g = G(param)