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

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [October 23, 2018, 8:48pm UTC](https://discourse.julialang.org/t/understanding-while-loop-undedvarerror-and-scope/16609/22 "2018-10-23T20:48:57Z")

</div>

> [@Vic](#):
>
> Which even more supports my point that if you allow `v[1]=1` inside loops, then you should allow `v = [1 1]` as well.

I had the assumption here that you wanted to understand and learn how Julia scope behaved but this is more and more getting into just repeating [Another possible solution to the global scope debacle](https://discourse.julialang.org/t/another-possible-solution-to-the-global-scope-debacle/15894) so I’ll just refer to that.

---

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