diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-11-29 15:56:02 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-11-29 15:56:02 -0500 |
| commit | 97047cb95a88228ddefbc83b4c50b05eaf048272 (patch) | |
| tree | fb6a57ef6c6fd8e18aba8b8c3e3c6bbf83d61ec6 /docs/iterators.md | |
| parent | d60962ab5de970a9ce0893df4154b8a0b3ea646a (diff) | |
Update docs
Diffstat (limited to 'docs/iterators.md')
| -rw-r--r-- | docs/iterators.md | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/docs/iterators.md b/docs/iterators.md index 9337d859..d1ff7b4b 100644 --- a/docs/iterators.md +++ b/docs/iterators.md @@ -14,15 +14,11 @@ successively gets one line from a file at a time until the file is exhausted: line three ") ->> iter := (./test.txt).each_line() ->> iter() -= "line one" : Text? ->> iter() -= "line two" : Text? ->> iter() -= "line three" : Text? ->> iter() -= none : Text? +iter := (./test.txt).each_line() +assert iter() == "line one" +assert iter() == "line two" +assert iter() == "line three" +assert iter() == none for line in (./test.txt).each_line() pass @@ -44,7 +40,6 @@ func primes_up_to(limit:Int) n += 1 return (n - 1)? ->> [p for p in primes_up_to(11)] -= [2, 3, 5, 7, 11] +assert [p for p in primes_up_to(11)] == [2, 3, 5, 7, 11] ``` |
