# C-style static variables

**URL:** <https://es.discourse.group/t/c-style-static-variables/511>\
**Category:** 💡 Ideas\
**Created:** [October 23, 2020, 9:43am UTC](https://es.discourse.group/t/c-style-static-variables/511 "2020-10-23T09:43:11Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![blob](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/blob/32/2230_2.png) [@blob](https://es.discourse.group/u/blob)\
**Post date:** [April 4, 2023, 8:47pm UTC](https://es.discourse.group/t/c-style-static-variables/511/4 "2023-04-04T20:47:54Z")

</div>

While the same effect can be achieved with closures, I actually strongly support this! It's an inconvenience to have to declare objects outside all the time to avoid unnecessary allocations. I have made a new topic for a syntax inside expressions, and have included this as an extension. Similarly to classes, I've made static variables accessible outside as a simple accessor on the function. Let me know what you think. ([my proposal](https://es.discourse.group/t/static-expr-syntax/1673))

---

_[View the full topic](https://es.discourse.group/t/c-style-static-variables/511)._
