# Understanding while loop UndedVarError and scope

**URL:** <https://discourse.julialang.org/t/understanding-while-loop-undedvarerror-and-scope/16609>\
**Category:** General Usage\
**Created:** [October 21, 2018, 7:07pm UTC](https://discourse.julialang.org/t/understanding-while-loop-undedvarerror-and-scope/16609 "2018-10-21T19:07:41Z")\
**Posts on this page:** 1\
**Showing post:** 19

<div class="post-metadata">

**Author:** ![Vic](https://avatars.discourse-cdn.com/v4/letter/v/9e8a1a/32.png) [@Vic](https://discourse.julialang.org/u/Vic)\
**Post date:** [October 23, 2018, 7:38pm UTC](https://discourse.julialang.org/t/understanding-while-loop-undedvarerror-and-scope/16609/19 "2018-10-23T19:38:33Z")

</div>

> [@kristoffer.carlsson](#):
>
> No, it means that the object `s` has been modified but it is the same object.

That’s sounds like a logical self-contradiction to me 🧐

You are showing that with mutation, the _address_ of the object remains the same: but then you interpret this to mean that the _object_ stays the same as well.

I “prove” the “same-ness” of the 2 objects like this 🙂

```
s=[0 0]; s[1] = 1;
s == [1 0]
true
s = [1 0];
s == [1 0]
true

```

---

_[View the full topic](https://discourse.julialang.org/t/understanding-while-loop-undedvarerror-and-scope/16609)._
