# Usage of local keyword in global scope

**URL:** <https://discourse.julialang.org/t/usage-of-local-keyword-in-global-scope/25325>\
**Category:** Internals & Design\
**Tags:** question\
**Created:** [June 15, 2019, 5:55am UTC](https://discourse.julialang.org/t/usage-of-local-keyword-in-global-scope/25325 "2019-06-15T05:55:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bkamins](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bkamins/32/208538_2.png) [@bkamins](https://discourse.julialang.org/u/bkamins)\
**Post date:** [June 15, 2019, 5:55am UTC](https://discourse.julialang.org/t/usage-of-local-keyword-in-global-scope/25325/1 "2019-06-15T05:55:01Z")

</div>

Currently `local` keyword is allowed in global scope. You can write things like:

```julia
local x = 1

```

or

```julia
local f() = 1

```

However, bindings to `x` nor `f` are not introduced in global scope and defining `f` effectively is equivalent to defining an anonymous function.

My question is is this intentional and has some use or usage of `local` should be disallowed in global scope? I could not find any discussion of this here nor on GitHub.

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [June 15, 2019, 10:04am UTC](https://discourse.julialang.org/t/usage-of-local-keyword-in-global-scope/25325/2 "2019-06-15T10:04:08Z")

</div>

[https://github.com/JuliaLang/julia/issues/10472](https://github.com/JuliaLang/julia/issues/10472)
