# How to pass variable into loop?

**URL:** <https://discourse.julialang.org/t/how-to-pass-variable-into-loop/25602>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [June 24, 2019, 1:14pm UTC](https://discourse.julialang.org/t/how-to-pass-variable-into-loop/25602 "2019-06-24T13:14:38Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [June 24, 2019, 1:43pm UTC](https://discourse.julialang.org/t/how-to-pass-variable-into-loop/25602/4 "2019-06-24T13:43:07Z")

</div>

Lots of deep thoughts about it:

> [@Another possible solution to the global scope debacle](https://discourse.julialang.org/t/another-possible-solution-to-the-global-scope-debacle/15894):
>
> The infamous issue [https://github.com/JuliaLang/julia/issues/28789](https://github.com/JuliaLang/julia/issues/28789) has been on most of our minds for a while now. Although I’ve stopped posting there, I can tell you I’ve been thinking about it a lot, as have Stefan and Jameson and others, and we have continued discussing it off and on. We should really try to get it right. Last time around, we more-or-less settled on changing only the REPL, which has the main advantage of being non-breaking for most code. But after sleeping on it, it does not …

and other threads.

I wouldn’t call it a debacle, actually I like it as it is or better: I like some of implications of it, e.g. one has to think about scope.

---

_[View the full topic](https://discourse.julialang.org/t/how-to-pass-variable-into-loop/25602)._
