From 1a196aa8f724971e531487f9cdd541f7957cfd92 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 6 Apr 2025 23:37:05 -0400 Subject: Update syntax in docs --- docs/iterators.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'docs/iterators.md') diff --git a/docs/iterators.md b/docs/iterators.md index 8d585ccb..9337d859 100644 --- a/docs/iterators.md +++ b/docs/iterators.md @@ -24,7 +24,7 @@ successively gets one line from a file at a time until the file is exhausted: >> iter() = none : Text? -for line in (./test.txt).each_line(): +for line in (./test.txt).each_line() pass ``` @@ -32,13 +32,13 @@ You can write your own iterator methods this way. For example, this iterator iterates over prime numbers up to a given limit: ```tomo -func primes_up_to(limit:Int): +func primes_up_to(limit:Int) n := 2 - return func(): - if n > limit: + return func() + if n > limit return !Int - while not n.is_prime(): + while not n.is_prime() n += 1 n += 1 -- cgit v1.2.3