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

<div class="post-metadata">

**Author:** ![swissr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/swissr/32/208_2.png) [@swissr](https://discourse.julialang.org/u/swissr)\
**Post date:** [October 7, 2018, 6:14pm UTC](https://discourse.julialang.org/t/another-possible-solution-to-the-global-scope-debacle/15894/182 "2018-10-07T18:14:53Z")

</div>

This is what I have suggested in [my post](https://discourse.julialang.org/t/another-possible-solution-to-the-global-scope-debacle/15894/61). However in the meantime I think I have changed my mind and prefer the solution proposed in this thread:

- no `global` annotation needed, IJulia could drop the ‘automatically-insert-global-hack’ (hopefully I’m not wrong here, didn’t use IJulia in 1.0 yet). REPL doesn’t ‘need’ a similar ‘~hack’.
- no (?) other language has such scoping rules in the for loop (is this true?)
- no surprises (1. there was a [mention](https://discourse.julialang.org/t/another-possible-solution-to-the-global-scope-debacle/15894/148) from a Matlab user at the breakfast table: you have to fix this – I think this is strong signal and bears weight, 2. there was a [‘bug report’](https://discourse.julialang.org/t/bug-with-julia-1-0-1/15964) exactly about this problem – another signal of unexpectedness)
- advanced users are more fit to declare what they want, i.e. write `local` when needed (`local for` is a cool idea, btw.)
- copy/paste from REPL to functions works right away without ‘global adjustment’
- former hard/soft scope complication is still solved

The only price is that the for scope is now global ([Edit]: maybe this is really bad, I’m not sure). – This said, I don’t feel competent enough to really state an opinion…

---

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