# Is it possible to know if a function has captured local variables?

**URL:** <https://discourse.julialang.org/t/is-it-possible-to-know-if-a-function-has-captured-local-variables/128934>\
**Category:** General Usage\
**Tags:** function\
**Created:** [May 12, 2025, 9:18pm UTC](https://discourse.julialang.org/t/is-it-possible-to-know-if-a-function-has-captured-local-variables/128934 "2025-05-12T21:18:49Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![Benny](https://avatars.discourse-cdn.com/v4/letter/b/49beb7/32.png) [@Benny](https://discourse.julialang.org/u/Benny)\
**Post date:** [May 13, 2025, 12:12am UTC](https://discourse.julialang.org/t/is-it-possible-to-know-if-a-function-has-captured-local-variables/128934/9 "2025-05-13T00:12:57Z")

</div>

> [@frankwswang](#):
>
> function capturing a global variable

That can’t happen. Capturing is just for local variables with scopes that can end. Global variables just exist whereever they are.

---

_[View the full topic](https://discourse.julialang.org/t/is-it-possible-to-know-if-a-function-has-captured-local-variables/128934)._
