# REPL and for loops (scope behavior change)

**URL:** <https://discourse.julialang.org/t/repl-and-for-loops-scope-behavior-change/13514>\
**Category:** General Usage\
**Created:** [August 15, 2018, 5:26pm UTC](https://discourse.julialang.org/t/repl-and-for-loops-scope-behavior-change/13514 "2018-08-15T17:26:35Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![Elrod](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/elrod/32/22461_2.png) [@Elrod](https://discourse.julialang.org/u/Elrod)\
**Post date:** [August 19, 2018, 7:41pm UTC](https://discourse.julialang.org/t/repl-and-for-loops-scope-behavior-change/13514/8 "2018-08-19T19:41:34Z")

</div>

It is not a bug.  
It worked in Julia 0.6, in Julia 0.7 it gave a deprecation warning that you must add `global`, and in 1.0 it throws an error.

I really like favba’s idea of starting by introducing functions and teaching them to write tiny functions. Sounds like that’d also end up encouraging good coding habits.

---

_[View the full topic](https://discourse.julialang.org/t/repl-and-for-loops-scope-behavior-change/13514)._
