4564b0d5a2
This is normally statically linked in releases. Lua also needs some patching in Linux x86 to fix performance issues related to alignment, will need patching if we want fine-grained threading, and generally has an odd "build it yourself" design, so let's just add embed this one. (note: disable PCH for these files in VC, and don't add lua.c, luac.c, or print.c to the project)
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
|