From 550bbd6e5fd2b02a5f1d13e1674fa36dc8f86839 Mon Sep 17 00:00:00 2001 From: ennisstephen Date: Sun, 22 Sep 2024 17:27:34 +0100 Subject: [PATCH] Correct inaccuracy in recursion description. --- examples/recursion/recursion.go | 6 +++--- examples/recursion/recursion.hash | 4 ++-- public/recursion | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/recursion/recursion.go b/examples/recursion/recursion.go index b85deb882..17d9c1dce 100644 --- a/examples/recursion/recursion.go +++ b/examples/recursion/recursion.go @@ -18,9 +18,9 @@ func fact(n int) int { func main() { fmt.Println(fact(7)) - // Closures can also be recursive, but this requires the - // closure to be declared with a typed `var` explicitly - // before it's defined. + // Anonymous functions can also be recursive, but this requires + // explicitly declaring a variable with `var` to store + // the function before it's defined. var fib func(n int) int fib = func(n int) int { diff --git a/examples/recursion/recursion.hash b/examples/recursion/recursion.hash index 7237c6a7b..832d7fc9b 100644 --- a/examples/recursion/recursion.hash +++ b/examples/recursion/recursion.hash @@ -1,2 +1,2 @@ -cdbd1a6957b3e2d7d9baa9efe4581ba4f8f3e753 -MBTKk9VpAiK +5787b4a187dc208dcdae43c7fdc0ba19b821ed94 +k4IRATLn9cE diff --git a/public/recursion b/public/recursion index bb53831b9..887189419 100644 --- a/public/recursion +++ b/public/recursion @@ -46,7 +46,7 @@ Here’s a classic example.

- +
package main
@@ -91,9 +91,9 @@ base case of fact(0).

-

Closures can also be recursive, but this requires the -closure to be declared with a typed var explicitly -before it’s defined.

+

Anonymous functions can also be recursive, but this requires +explicitly declaring a variable with var to store +the function before it’s defined.