diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2019-03-20 15:55:57 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2019-03-20 15:55:57 -0700 |
| commit | e665d9725c4bb02f4c18d16527367f424cb880fa (patch) | |
| tree | aed161ee6b338c2bad2312591f746459414ccafa /lib/core/coroutines.nom | |
| parent | 606fd090002f3d545cbd58440e96624907846f45 (diff) | |
Auto-updated to 7.0.0 syntax and removed some shims.
Diffstat (limited to 'lib/core/coroutines.nom')
| -rw-r--r-- | lib/core/coroutines.nom | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/lib/core/coroutines.nom b/lib/core/coroutines.nom index b151a4b..a11d6ee 100644 --- a/lib/core/coroutines.nom +++ b/lib/core/coroutines.nom @@ -1,5 +1,6 @@ -#!/usr/bin/env nomsu -V6.15.13.8 -# +#!/usr/bin/env nomsu -V7.0.0 + +### This file defines the code that creates and manipulates coroutines use "core/metaprogramming" @@ -16,11 +17,8 @@ test: repeat 3 times: yield 6 $nums = [] - for $ in (coroutine from $fn): - $nums, add $ - + for $ in (coroutine from $fn): $nums, add $ assume ($nums == [4, 5, 6, 6, 6]) - $d = {.x = 0} $co = coroutine: @@ -35,7 +33,6 @@ test: [$ok, $val] = (co) assume ($ok == (yes)) assume ($val == 5) - $t = [] $i = 1 for $ in @@ -47,8 +44,7 @@ test: ..: $t.$i = $ $i += 1 - assume ($t == [4,5,nil,6]) - + assume ($t == [4, 5, nil, 6]) $t = [] for ($k = $) in coroutine: @@ -58,11 +54,11 @@ test: yield 6 ..: $t, add {.key = $k, .value = $} + assume $t == [ {.key = 1, .value = 4}, {.key = 2, .value = 5}, {.key = 3}, {.key = 4, .value = 6} ] - -(coroutine $body) parses as (coroutine from (-> $body)) +(coroutine $body) parses as (coroutine from ->$body) external: ($ is a dead coroutine) means - ((lua type of $) == "thread") and ((coroutine status of $) == "dead") + ((lua type of $) == "thread") and ((coroutine status of $) == "dead")
\ No newline at end of file |
