From e43191b60c3d4e2ddf0fbe31f2936eda19505ab1 Mon Sep 17 00:00:00 2001 From: Drew Youngwerth Date: Sun, 22 Sep 2024 20:28:01 -0700 Subject: [PATCH] Update README.md (#51) --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 642c4fb..04cbd4f 100644 --- a/README.md +++ b/README.md @@ -221,6 +221,18 @@ for item in iterable do: print item ``` +Voyd is also tail call optimized: + +``` +// This function is super speedy and uses very little memory +pub fn fib(n: i32, a: i32, b: i32) -> i32 + if n < 1 then: a + else: fib(n - 1, b, a + b) + +pub fn main() -> i32 + fib(10, 0, 1) +``` + ## Structural Objects Structural objects are types compatible with any other type containing