# Another possible solution to the global scope debacle

**URL:** <https://discourse.julialang.org/t/another-possible-solution-to-the-global-scope-debacle/15894>\
**Category:** Internals & Design\
**Created:** [October 4, 2018, 6:14pm UTC](https://discourse.julialang.org/t/another-possible-solution-to-the-global-scope-debacle/15894 "2018-10-04T18:14:07Z")\
**Posts on this page:** 1\
**Showing post:** 232

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [October 23, 2018, 9:00pm UTC](https://discourse.julialang.org/t/another-possible-solution-to-the-global-scope-debacle/15894/232 "2018-10-23T21:00:03Z")

</div>

The proposal for my new solution is here:

> [@New scope solution](https://discourse.julialang.org/t/new-scope-solution/16707):
>
> I have an alternate, non-breaking solution to the scope issue previously discussed on [discourse](https://discourse.julialang.org/t/another-possible-solution-to-the-global-scope-debacle/15894) and [github](https://github.com/JuliaLang/julia/issues/28789). The new potential solution is the following rule to decide whether a variable, x, which is not marked as explicitly local or glogal and which is assigned to in a top-level scope construct is local or global: x is global if it is accessed before being assigned on all paths through the scope body. In other words, x is local unless there’s no way it could make sense for it to be local. Or…

---

_[View the full topic](https://discourse.julialang.org/t/another-possible-solution-to-the-global-scope-debacle/15894)._
