# Julia's assignment behavior differs from Fortran?

**URL:** <https://discourse.julialang.org/t/julias-assignment-behavior-differs-from-fortran/50389>\
**Category:** General Usage\
**Tags:** fortran\
**Created:** [November 18, 2020, 1:24pm UTC](https://discourse.julialang.org/t/julias-assignment-behavior-differs-from-fortran/50389 "2020-11-18T13:24:15Z")\
**Posts on this page:** 1\
**Showing post:** 45

<div class="post-metadata">

**Author:** ![Nathan\_Boyer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nathan_boyer/32/14825_2.png) [@Nathan\_Boyer](https://discourse.julialang.org/u/Nathan_Boyer)\
**Post date:** [November 18, 2020, 7:19pm UTC](https://discourse.julialang.org/t/julias-assignment-behavior-differs-from-fortran/50389/45 "2020-11-18T19:19:44Z")

</div>

I think I understand what is going on under the hood based on this discussion. Can someone confirm that my comments are accurate?

```julia
x=[2] # x points to memory location m1
y=x # y points to memory location m1
x=[3] # x points to memory location m2, y still points to m1
z=x # z points to memory location m2
x[1]=4 # m2 changes value in place, affecting all variables that point there

```

```julia
julia> println(x,y,z)
[4][2][4]

```

---

_[View the full topic](https://discourse.julialang.org/t/julias-assignment-behavior-differs-from-fortran/50389)._
