Please help, how to intercept get and set variable of module in Julia 1.8 ?
julia> module M end;
julia> # in julia 1.9 i can do this:
julia> function Base.setproperty!(m::Module, p::Symbol, v)
println("variable $p changed on $v in module $m")
return setglobal!(m, p, v)
end;
julia> # what about julia 1.8 ?
julia> M.x = 1;
variable x changed on 1 in module Main.M
function Base.setproperty!(m::Module, p::Symbol, v)
println("variable $p changed on $v in module $m")
@eval m $p = $v # waiting for julia 1.9 and will use setglobal!()
end;