# Scope behaviors in Atom (Juno)

**URL:** <https://discourse.julialang.org/t/scope-behaviors-in-atom-juno/46706>\
**Category:** General Usage\
**Created:** [September 16, 2020, 11:33am UTC](https://discourse.julialang.org/t/scope-behaviors-in-atom-juno/46706 "2020-09-16T11:33:30Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [September 16, 2020, 3:14pm UTC](https://discourse.julialang.org/t/scope-behaviors-in-atom-juno/46706/12 "2020-09-16T15:14:44Z")

</div>

> [@goodluck](#):
>
> i must say that i do not understand this scoping rule, it seems completely counterintuitive to me.

Love it or hate it, one just has to accept it at this point — it can’t be changed in Julia 1.x for non-interactive code without breaking backwards compatibility, which we won’t do.

Background: when Julia 1.0 was released, many people started complaining about the new scoping rules and there was extensive discussion. See e.g.

- [Global variable scope rules lead to unintuitive behavior at the REPL/notebook · Issue #28789 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/issues/28789) and [RFC: bring back v0.6 scope rules in the REPL by JeffBezanson · Pull Request #33864 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/pull/33864)
- Many, many discussions on discourse, e.g. [REPL and for loops (scope behavior change)](https://discourse.julialang.org/t/repl-and-for-loops-scope-behavior-change/13514) … [Remove the soft scope altogether and make it global](https://discourse.julialang.org/t/remove-the-soft-scope-altogether-and-make-it-global/33333) … [Explain scoping confusion to a programming beginner](https://discourse.julialang.org/t/explain-scoping-confusion-to-a-programming-beginner/43206) …

However, putting aside any discussion of the merits of one rule or another, the scoping rules could not be changed in files/modules after Julia 1.0 was released because of the backward-compatibility guarantee (until Julia 2.0 in the _distant_ future). See also [PSA: Julia is not at that stage of development anymore](https://discourse.julialang.org/t/psa-julia-is-not-at-that-stage-of-development-anymore/44872). As a compromise solution, after much debate, the behavior was changed in the interactive REPL (following an earlier experiment in IJulia) — and other interactive environments (vsCode and hopefully soon Juno) are now following suit — with a warning for code in files (scripts and modules).

At this point, there is no point in arguing about it — there is no argument you could possibly make that has not already been made dozens of times.

---

_[View the full topic](https://discourse.julialang.org/t/scope-behaviors-in-atom-juno/46706)._
