suppose I have two vectors:
a = [1, 2];
b = [3, 4]
how could I create a single “reference” vector c
, which is a concatenation of a
and b
, so that any changes in each would be reflected in the others??
for example, below is a failed attempt:
julia> c = [view(a, :); view(b, :)]
4-element Array{Int64,1}:
1
2
3
4
julia> a[1] = 10
10
julia> c
4-element Array{Int64,1}:
1
2
3
4
here c
is a concrete vector rather than a reference, hence any changes in a
is not able to see in c
.
please help