# I define t, then in a loop I'm told it's undefined, why?

**URL:** https://discourse.julialang.org/t/i-define-t-then-in-a-loop-im-told-its-undefined-why/41258
**Category:** New to Julia
**Created:** [June 12, 2020, 10:39am UTC](https://discourse.julialang.org/t/i-define-t-then-in-a-loop-im-told-its-undefined-why/41258 "2020-06-12T10:39:56Z")
**Posts on this page:** 1
**Showing post:** 13

<div class="post-metadata">

### Author: ![erlebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/erlebach/32/12973_2.png) [@erlebach](https://discourse.julialang.org/u/erlebach)
#### Post date: [June 23, 2020, 12:02pm UTC](https://discourse.julialang.org/t/i-define-t-then-in-a-loop-im-told-its-undefined-why/41258/13 "2020-06-23T12:02:18Z")

</div>

Yes, I realized the trick, and use it. However, this implies that the behavior is different from what I thought.  
In Julia, one should never assume that loop variables are accessible from outside the loop context. Thank you.

---

_[View the full topic](https://discourse.julialang.org/t/i-define-t-then-in-a-loop-im-told-its-undefined-why/41258)._
