mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-24 09:20:06 +08:00
15 lines
186 B
Lua
15 lines
186 B
Lua
|
|
||
|
local f = function(xyz)
|
||
|
print('calling 1', xyz)
|
||
|
local foo = coroutine.yield()
|
||
|
print('calling 2', foo)
|
||
|
return 5
|
||
|
end
|
||
|
|
||
|
local x = coroutine.wrap(f)
|
||
|
|
||
|
x('bar')
|
||
|
x('zap')
|
||
|
-- x()
|
||
|
-- x()
|