mirror of
https://github.com/fluencelabs/redis
synced 2025-06-22 13:31:32 +00:00
deps
hiredis
jemalloc
linenoise
lua
doc
etc
src
test
README
bisect.lua
cf.lua
echo.lua
env.lua
factorial.lua
fib.lua
fibfor.lua
globals.lua
hello.lua
life.lua
luac.lua
printf.lua
readonly.lua
sieve.lua
sort.lua
table.lua
trace-calls.lua
trace-globals.lua
xd.lua
COPYRIGHT
HISTORY
INSTALL
Makefile
README
Makefile
README.md
update-jemalloc.sh
src
tests
utils
.gitignore
00-RELEASENOTES
BUGS
CONTRIBUTING
COPYING
INSTALL
MANIFESTO
Makefile
README.md
redis.conf
runtest
runtest-cluster
runtest-sentinel
sentinel.conf
14 lines
254 B
Lua
14 lines
254 B
Lua
![]() |
-- example of for with generator functions
|
||
|
|
||
|
function generatefib (n)
|
||
|
return coroutine.wrap(function ()
|
||
|
local a,b = 1, 1
|
||
|
while a <= n do
|
||
|
coroutine.yield(a)
|
||
|
a, b = b, a+b
|
||
|
end
|
||
|
end)
|
||
|
end
|
||
|
|
||
|
for i in generatefib(1000) do print(i) end
|