From 67545862b2af396efbc26e937afc41d63f16bbc7 Mon Sep 17 00:00:00 2001 From: Drew Youngwerth Date: Sun, 22 Sep 2024 20:27:20 -0700 Subject: [PATCH] Update README.md --- 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