# Does Julia Need a C++ style \`static\` keyword?

**URL:** <https://discourse.julialang.org/t/does-julia-need-a-c-style-static-keyword/29176>\
**Category:** Internals & Design\
**Created:** [September 25, 2019, 8:24pm UTC](https://discourse.julialang.org/t/does-julia-need-a-c-style-static-keyword/29176 "2019-09-25T20:24:33Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![antoine-levitt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/antoine-levitt/32/4008_2.png) [@antoine-levitt](https://discourse.julialang.org/u/antoine-levitt)\
**Post date:** [September 26, 2019, 9:21am UTC](https://discourse.julialang.org/t/does-julia-need-a-c-style-static-keyword/29176/4 "2019-09-26T09:21:00Z")

</div>

The idiomatic answer to this is `let`, I believe:

```julia
let z = 0
    global function incrementZ()
        z += 1
        return z
    end
end

println(incrementZ())
println(incrementZ())

```

---

_[View the full topic](https://discourse.julialang.org/t/does-julia-need-a-c-style-static-keyword/29176)._
