From 4a597886e635988529b6dfe6e4c33421200e4d25 Mon Sep 17 00:00:00 2001 From: sergeych Date: Mon, 2 Jun 2025 18:11:58 +0400 Subject: [PATCH] polishing sample --- docs/tutorial.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/tutorial.md b/docs/tutorial.md index dee1c30..f3be0ba 100644 --- a/docs/tutorial.md +++ b/docs/tutorial.md @@ -596,7 +596,8 @@ Lyng to skip it. The while and for loops can be followed by the else block, which is executed when the loop ends normally, without breaks. It allows override loop result value, for example, -to not calculate it in every iteration. See for loop example just below. +to not calculate it in every iteration. For example, consider this naive prime number +test function (remember function return it's last expression result): fun naive_is_prime(candidate) { val x = if( candidate !is Int) candidate.toInt() else candidate