# Functions with recursion for mutidispatch

**URL:** <https://discourse.julialang.org/t/functions-with-recursion-for-mutidispatch/91508>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [December 10, 2022, 11:37am UTC](https://discourse.julialang.org/t/functions-with-recursion-for-mutidispatch/91508 "2022-12-10T11:37:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![xuanquansheng](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xuanquansheng/32/32400_2.png) [@xuanquansheng](https://discourse.julialang.org/u/xuanquansheng)\
**Post date:** [December 10, 2022, 11:37am UTC](https://discourse.julialang.org/t/functions-with-recursion-for-mutidispatch/91508/1 "2022-12-10T11:37:09Z")

</div>

Julia packages often have many different types of functions with the same name to achieve multidispatch, but these functions are usually called recursively, and finally stop at a certain function（an orthorhombic design）.  
Is there any way to easily check which version of the function is called in each step of the chain of recursive calls?

---

<div class="post-metadata">

**Author:** ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Post date:** [December 10, 2022, 1:14pm UTC](https://discourse.julialang.org/t/functions-with-recursion-for-mutidispatch/91508/2 "2022-12-10T13:14:02Z")

</div>

[Cthulhu.jl](https://github.com/JuliaDebug/Cthulhu.jl) offers `@descend` to step down into the rabbit hole (and madness).

---

<div class="post-metadata">

**Author:** ![xuanquansheng](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xuanquansheng/32/32400_2.png) [@xuanquansheng](https://discourse.julialang.org/u/xuanquansheng)\
**Post date:** [December 10, 2022, 2:31pm UTC](https://discourse.julialang.org/t/functions-with-recursion-for-mutidispatch/91508/3 "2022-12-10T14:31:59Z")

</div>

Thanks a lot! It may give too much details(as you say: madness).Maybe the official of julia should provide a concise solution

---

<div class="post-metadata">

**Author:** ![bertschi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bertschi/32/33462_2.png) [@bertschi](https://discourse.julialang.org/u/bertschi)\
**Post date:** [December 10, 2022, 3:28pm UTC](https://discourse.julialang.org/t/functions-with-recursion-for-mutidispatch/91508/4 "2022-12-10T15:28:00Z")

</div>

For exactly that purpose I had created a small package [TraceFuns.jl](https://github.com/bertschi/TraceFuns.jl). Maybe it helps in your case as well.

---

<div class="post-metadata">

**Author:** ![xuanquansheng](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xuanquansheng/32/32400_2.png) [@xuanquansheng](https://discourse.julialang.org/u/xuanquansheng)\
**Post date:** [December 11, 2022, 11:40am UTC](https://discourse.julialang.org/t/functions-with-recursion-for-mutidispatch/91508/5 "2022-12-11T11:40:30Z")

</div>

thx, it help me this pkg did help me in some extend.
