I am trying to understand the difference between copy()
and deepcopy()
in Julia. Based on what I read in the Julia docs it seems like deepcopy()
copies the values and then makes a while new object un-related to the original object that I copied from. That part makes sense. I am more so confused about the relationship between the following objects:
julia> a = [1,2,3]
3-element Array{Int64,1}:
1
2
3
julia> b = copy(a)
3-element Array{Int64,1}:
1
2
3
julia> a == b
true
julia> isequal(a,b)
true
Maybe this is just a bad example I chose above but I don't how deep copying would provide a different result (maybe it won't in my simple example but is there a tried and true example that highlights the difference between deep and regular copy?).