Hello everybody,
I am trying to use Ref to change a variable, and it does not work as expected (at least, as I expected).
julia> a = 5
5
julia> typeof(a)
Int64
julia> b = Ref(a)
Base.RefValue{Int64}(5)
julia> typeof(b)
Base.RefValue{Int64}
julia> b[] = 10
10
julia> b
Base.RefValue{Int64}(10)
julia> a
5
I believed that changing b the variable a should be changed. I think previously it was working in that way, but now it does not.
I actually does not use directly Ref, but I try to change results of a package in Python that uses PyCall (pysr). In a previous version, I could change the internal structure (using small functions in Julia) but now it is not working now, it is like it was a copy. Studying that I come to this expected (for me) behaviour.
Could anyone confirm this is working as expected?
Thank a lot.