# Is there a \`recur\` syntax to call the current function?

**URL:** <https://discourse.julialang.org/t/is-there-a-recur-syntax-to-call-the-current-function/37816>\
**Category:** General Usage\
**Tags:** syntax, design, loops, function\
**Created:** [April 18, 2020, 8:00pm UTC](https://discourse.julialang.org/t/is-there-a-recur-syntax-to-call-the-current-function/37816 "2020-04-18T20:00:20Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![tkf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkf/32/17635_2.png) [@tkf](https://discourse.julialang.org/u/tkf)\
**Post date:** [April 19, 2020, 12:44am UTC](https://discourse.julialang.org/t/is-there-a-recur-syntax-to-call-the-current-function/37816/3 "2020-04-19T00:44:17Z")

</div>

IIUC, Clojure has to workaround the problem that JVM does not have TCO. So I guess it makes sense for Clojure to use `recur`?

In Julia, I think recurring to the same method makes less sense as the plain `for` syntax is more idiomatic way to write loops. But it’d be nice to have a syntax for tail-call into different method since, in principle, the compiler can build a finite state machine out of this. This would be more powerful tool than union splitting when writing generic reductions: [Tail-call optimization and function-barrier -based accumulation in loops](https://discourse.julialang.org/t/tail-call-optimization-and-function-barrier-based-accumulation-in-loops/25831)

---

_[View the full topic](https://discourse.julialang.org/t/is-there-a-recur-syntax-to-call-the-current-function/37816)._
