From d917922c4bc814eb105f6e89e12e6c2d08916190 Mon Sep 17 00:00:00 2001 From: Jakub Jankiewicz Date: Fri, 1 Mar 2024 22:11:46 +0100 Subject: [PATCH] extend section about TCO --- docs/docs/scheme-intro/core.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/docs/scheme-intro/core.md b/docs/docs/scheme-intro/core.md index a37aa2c3f..22ca33008 100644 --- a/docs/docs/scheme-intro/core.md +++ b/docs/docs/scheme-intro/core.md @@ -451,6 +451,10 @@ This function is similar to previous recursive function, but note that loop is t the result of loop don't need to wait on anything. This type of code is optimized by Scheme and can recur any number of types. +If you need to create a recursive procedure that accumulate something, like create a list of create +a value, you need to add additional variable where you will old that value, the local variable is +ofen called result, but you can name it like you want. + ## Loops Recursion is not the only way to create loops in Scheme. You also have `do` syntax: