Lam Pham
1 min readSep 11, 2020

--

tail-recursive function is only a recursion so it does not resolve stackoverflow, but when you add tailrec into the declaration, compiler will translate it to a looping. So

- tail-recursive function = recursion -> stackoverflow

- tail-recursive function + tailrec -> no more stackoverflow

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Lam Pham
Lam Pham

Responses (1)

Write a response