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

<div class="post-metadata">

**Author:** ![tim.holy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tim.holy/32/52_2.png) [@tim.holy](https://discourse.julialang.org/u/tim.holy)\
**Post date:** [October 6, 2018, 10:27am UTC](https://discourse.julialang.org/t/another-possible-solution-to-the-global-scope-debacle/15894/152 "2018-10-06T10:27:12Z")

</div>

Late to the party here.

> making everything outside of a function global, _unless_ it is explicitly declared with `local` or `let`

Would variables inside the body of a `let` block be global? (Presumably, yes, see [here](https://discourse.julialang.org/t/another-possible-solution-to-the-global-scope-debacle/15894/106).) If so, then IIUC this would nix being able to reliably copy/paste the body of a function into a `let` block (a common debugging strategy, whether performed manually or via Rebugger). For example, if I did this for a function which had a line `first = true` (defining a local variable named `first`), would I henceforth get the equivalent of

```julia
julia> first = true
true

julia> first([1,2,3])
ERROR: MethodError: objects of type Bool are not callable
Stacktrace:
 [1] top-level scope at none:0

```

?

In my own usage, simplifying 3-line REPL demos is not worth messing up systematic strategies; while I recognize the problem this issue is causing, for me personally this kind of change would be a step backwards.

_However_, being able to say [`local let ... end`](https://discourse.julialang.org/t/another-possible-solution-to-the-global-scope-debacle/15894/107) does seem like it would solve this problem. Can we keep that option on the table?

---

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