diff options
Diffstat (limited to 'examples/redis-unstable/deps/lua/test/fibfor.lua')
| -rw-r--r-- | examples/redis-unstable/deps/lua/test/fibfor.lua | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/examples/redis-unstable/deps/lua/test/fibfor.lua b/examples/redis-unstable/deps/lua/test/fibfor.lua deleted file mode 100644 index 8bbba39..0000000 --- a/examples/redis-unstable/deps/lua/test/fibfor.lua +++ /dev/null | |||
| @@ -1,13 +0,0 @@ | |||
| 1 | -- example of for with generator functions | ||
| 2 | |||
| 3 | function generatefib (n) | ||
| 4 | return coroutine.wrap(function () | ||
| 5 | local a,b = 1, 1 | ||
| 6 | while a <= n do | ||
| 7 | coroutine.yield(a) | ||
| 8 | a, b = b, a+b | ||
| 9 | end | ||
| 10 | end) | ||
| 11 | end | ||
| 12 | |||
| 13 | for i in generatefib(1000) do print(i) end | ||
