-
Notifications
You must be signed in to change notification settings - Fork 1
Coroutines
Kevin Zhao edited this page Jan 25, 2018
·
2 revisions
Most other Lua embedding libraries do not properly support .NET bindings within coroutines. This problem is solved in Triton by relaxing the requirements of what state pointers can be used with a given Lua
environment. Thus, the following will work perfectly:
lua.DoString(@"
list = List(String)()
co = coroutine.create(function()
Console.WriteLine('test')
x = coroutine.yield()
list:Add(x)
Console.WriteLine(x)
end)
coroutine.resume(co)
coroutine.resume(co, 'test 2')