BY Simmi Kava10 Aug 2021 Edit
Trampoline

What is a Trampoline function?


In Computer Programming, trampoline is associated with Jump Instructions i.e. moving to different code paths.

In functional programming, a trampoline is a loop that iteratively invokes thunk-returning functions. i.e. instead of making a recursive call to a function, we return an instruction (thunk) to call that function, to be interpreted in a loop.

Trampoline calls the recursive function in pieces until it no longer produces iterative/recursive calls. It takes recursive function as its argument, wraps it and returns a new function. Within the new function, the recursive function is called. The loop keeps running until function resolves into a value.

Use: To implement tail-recursive calls in stack-oriented programming languages.

References: Blog Article1 | Article 2

BY Simmi Kava
LikeCommentSave
LikeCommentSaveShare
0

POPULAR POSTS
17 Mar 2021
LATEST ACTIVITY
srikanth.naidu
liked this post.
malli
saved this post.
Show more
ARCHIVES
2021
2020
2019
2018
TAGS
javascript (41)
developer (25)
javascriptdeveloper (15)
coding (10)
Xamarin.Forms (10)
webatoms (8)
arrays (7)
xamarin (7)
android (6)
typescript (6)
function (5)
csharp (4)
iOS (4)
methods (4)
object (4)
update (4)
web-atoms (4)
arrayoperation (3)
decorators (3)
programming (3)
prototype (3)




Web Atoms: JSX (TSX + TypeScript) for Xamarin.Forms, Hot Reload Your App in Production Environment

PlaygroundSamples Repository