Skip to content

Commit 3aa4cdd

Browse files
committed
first draft of recursion, thunks and trampolines
1 parent a659f92 commit 3aa4cdd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

_posts/2025-04-11-recursion-thunks-trampolines-with-java-and-scala.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ Thunks are fundamental building blocks for several powerful techniques:
281281

282282
Imagine instead of climbing a huge staircase (deepening the call stack), you're bouncing on a trampoline. You always return to the trampoline's surface (a central control loop) before taking the next bounce (the next computation step)
283283

284-
![trampoline.png]({{site.baseurl}}/magnussmith/assets/trampoline.png "Image from bartdesmet.net)
284+
![trampoline.png]({{site.baseurl}}/magnussmith/assets/trampoline.png)
285285

286286
The Trampoline pattern is designed to execute deeply recursive (especially tail-recursive) computations without blowing the stack. It does this by replacing direct recursive calls with returning an object representing the next computation step. A controlling loop then executes these steps iteratively.
287287

0 commit comments

Comments
 (0)