# Function closures and ifelse with unexpected behaviour

**URL:** <https://discourse.julialang.org/t/function-closures-and-ifelse-with-unexpected-behaviour/45694>\
**Category:** New to Julia\
**Tags:** closure\
**Created:** [August 28, 2020, 2:32pm UTC](https://discourse.julialang.org/t/function-closures-and-ifelse-with-unexpected-behaviour/45694 "2020-08-28T14:32:34Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![jmert](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jmert/32/3161_2.png) [@jmert](https://discourse.julialang.org/u/jmert)\
**Post date:** [August 28, 2020, 2:47pm UTC](https://discourse.julialang.org/t/function-closures-and-ifelse-with-unexpected-behaviour/45694/2 "2020-08-28T14:47:52Z")

</div>

See [this previous question](https://discourse.julialang.org/t/confused-by-behaviour-of-nested-functions/20576) which boils down the same problem.

---

_[View the full topic](https://discourse.julialang.org/t/function-closures-and-ifelse-with-unexpected-behaviour/45694)._
