luabind::resume_function

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

luabind::resume_function

Alexander Gladysh
Hi all!

Luabind b7, Lua 5.0.2.

While calling luabind::resume_function<void> on my coroutine object,
I've got assertion on call_function.hpp at line 264. What does this
assertion mean?

My code is somewhat complicated, but I will try to extract minimal
version if needed to find the cause of this assertion.

Thanks,
Alexander.

P.S. Is Luabind b7 compatible with new Lua 5.1?


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
<a href="http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642">http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user
Reply | Threaded
Open this post in threaded view
|

Re: luabind::resume_function

Arvid Norberg

On Feb 26, 2006, at 22:25, Alexander Gladysh wrote:

> Hi all!
>
> Luabind b7, Lua 5.0.2.

Hi. Sorry for the late reply.

> While calling luabind::resume_function<void> on my coroutine object,
> I've got assertion on call_function.hpp at line 264. What does this
> assertion mean?

The intention is to make sure that the failing function left an error  
message on the lua stack before it called error().

> My code is somewhat complicated, but I will try to extract minimal
> version if needed to find the cause of this assertion.
>
> Thanks,
> Alexander.
>
> P.S. Is Luabind b7 compatible with new Lua 5.1?

We haven't had time to test this yet, but posts on this list suggests  
it's not.

--
Arvid Norberg




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user
Reply | Threaded
Open this post in threaded view
|

Re: luabind::resume_function

Alexander Gladysh
> > While calling luabind::resume_function<void> on my coroutine object,
> > I've got assertion on call_function.hpp at line 264. What does this
> > assertion mean?

> The intention is to make sure that the failing function left an error
> message on the lua stack before it called error().

Then perhaps it would be nice to add appropriate comment in that
source file or directly in that assert call...

Thanks,
Alexander.


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
<a href="http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642">http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user
Reply | Threaded
Open this post in threaded view
|

Re: luabind::resume_function

Alexander Gladysh
In reply to this post by Arvid Norberg
> > While calling luabind::resume_function<void> on my coroutine object,
> > I've got assertion on call_function.hpp at line 264. What does this
> > assertion mean?
>
> The intention is to make sure that the failing function left an error
> message on the lua stack before it called error().

By the way, if I interprete Lua manual correctly, in the case of error
lua_resume() clears the stack, and leaves only the error message on
it. So this assertion may be wrong for this case.

Quote from http://www.lua.org/manual/5.0/manual.html#3.20 :

To start a coroutine, you first create a new thread; then you push on
its stack the body function plus any eventual arguments; then you call
lua_resume, with narg being the number of arguments. This call returns
when the coroutine suspends or finishes its execution. When it
returns, the stack contains all values passed to lua_yield, or all
values returned by the body function. lua_resume returns 0 if there
are no errors running the coroutine, or an error code (see 3.15). ***
In case of errors, the stack contains only the error message. *** To
restart a coroutine, you put on its stack only the values to be passed
as results from yield, and then call lua_resume.

With best regards,
Alexander.


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
<a href="http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642">http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user