Luabind and coroutines
I'm having some trouble understanding how to use coroutines properly with luabind. There's a templated function:

    template<class Ret> 
    Ret resume_function(object const& obj, ...)

Where (`Ret`) is supposed to contain the values passed to `yield` by Lua.

My current points of confusion are:

- What happens if the function returns rather than calling `yield`? Does `resume_function` return the function's return value?
- How are you supposed to use this function if you don't know ahead of time which (or how many) parameters will be passed to `yield`? For example, if there are multiple possible yielding functions the function may call.
- What is the type of `Ret` if multiple values are passed to `yield`?

Am I just entirely mistaken as to how all this works? I envision something like this. On the Lua side:

    local img = loadImage("foo.png")

`loadImage` would be a C++ function which requests the image to be loaded in a different thread and then calls `lua_yield`, and some time later `luabind::resume_function` gets called with `img` as a parameter.

Should I pass `"foo.png"` to `yield` as a parameter? To a different function before I call `yield`, and then never pass any values to `yield`? What's the right way to structure this? I'm obviously misunderstanding something here.

Luabind and coroutines
===

I'm having some trouble understanding how to use coroutines properly with luabind. There's a templated function:

    template<class Ret> 
    Ret resume_function(object const& obj, ...)

Where (`Ret`) is supposed to contain the values passed to `yield` by Lua.

My current points of confusion are:

- What happens if the function returns rather than calling `yield`? Does `resume_function` return the function's return value?
- How are you supposed to use this function if you don't know ahead of time which (or how many) parameters will be passed to `yield`? For example, if there are multiple possible yielding functions the function may call.
- What is the type of `Ret` if multiple values are passed to `yield`?

Am I just entirely mistaken as to how all this works? I envision something like this. On the Lua side:

    local img = loadImage("foo.png")

`loadImage` would be a C++ function which requests the image to be loaded in a different thread and then calls `lua_yield`, and some time later `luabind::resume_function` gets called with `img` as a parameter.

Should I pass `"foo.png"` to `yield` as a parameter? To a different function before I call `yield`, and then never pass any values to `yield`? What's the right way to structure this? I'm obviously misunderstanding something here.
