diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-04-06 23:37:05 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-04-06 23:37:05 -0400 |
| commit | 1a196aa8f724971e531487f9cdd541f7957cfd92 (patch) | |
| tree | 52a36701065ab0e3f7012765c909c3b2a3fd2e49 /docs/iterators.md | |
| parent | 4a3db447ce820617a72bdd9fc6217c84c3799bea (diff) | |
Update syntax in docs
Diffstat (limited to 'docs/iterators.md')
| -rw-r--r-- | docs/iterators.md | 10 |
1 files changed, 5 insertions, 5 deletions
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 |
