diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-04-06 16:07:23 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-04-06 16:07:23 -0400 |
| commit | 6782cc5570e194791ca6cdd695b88897e9145564 (patch) | |
| tree | a428e9d954aca251212ec1cf15bd35e0badce630 /test/iterators.tm | |
| parent | 448e805293989b06e07878a4a87fdd378f7c6e02 (diff) | |
No more colons for blocks
Diffstat (limited to 'test/iterators.tm')
| -rw-r--r-- | test/iterators.tm | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/test/iterators.tm b/test/iterators.tm index 64d21ea3..1816fd7a 100644 --- a/test/iterators.tm +++ b/test/iterators.tm @@ -1,22 +1,22 @@ struct Pair(x:Text, y:Text) -func pairwise(strs:[Text] -> func(->Pair?)): +func pairwise(strs:[Text] -> func(->Pair?)) i := 1 - return func(): - if i + 1 > strs.length: return none + return func() + if i + 1 > strs.length return none i += 1 return Pair(strs[i-1], strs[i])? -func range(first:Int, last:Int -> func(->Int?)): +func range(first:Int, last:Int -> func(->Int?)) i := first - return func(): - if i > last: + return func() + if i > last return none i += 1 return (i-1)? -func main(): +func main() values := ["A", "B", "C", "D"] >> (++: "($(foo.x)$(foo.y))" for foo in pairwise(values))! @@ -24,9 +24,9 @@ func main(): >> ["$(foo.x)$(foo.y)" for foo in pairwise(values)] = ["AB", "BC", "CD"] - do: + do result : @[Text] = @[] - for foo in pairwise(values): + for foo in pairwise(values) result.insert("$(foo.x)$(foo.y)") >> result[] = ["AB", "BC", "CD"] |
