# 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:** 22

<div class="post-metadata">

**Author:** ![Henrique\_Becker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henrique_becker/32/15443_2.png) [@Henrique\_Becker](https://discourse.julialang.org/u/Henrique_Becker)\
**Post date:** [November 18, 2020, 3:11pm UTC](https://discourse.julialang.org/t/julias-assignment-behavior-differs-from-fortran/50389/22 "2020-11-18T15:11:42Z")

</div>

You are still thinking of variables as boxes, please look at [the post I linked above](https://discourse.julialang.org/t/is-it-appropriate-to-say-a-variable-is-a-label-or-box/46068/19).

> [@CosmoProf](#):
>
> By the previous logic, `xNew` is bound to `xOld+1` .

No. `xNew` is bound to the value resulting from `xOld+1` which is `2`. `xNew` is not a closure which will always recompute its value when the variables used to define it are changed. What happened previously happened because you were dealing with a `mutable` object (a `Vector`/`Array`). You used two variables/labels to refer to the same object, and you changed _inside_ the mutable object. So it reflected in the two variables because they are just names for the same object that now is different than it previously was.

---

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