lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



in lua.h, line 43:
#define LUA_YIELD 1
 
and notice that
(luaL_loadstring(L, str) || lua_pcall(L, 0, LUA_MULTRET, 0))
 
it's return value is a boolean, so luaL_dofile only returns 0 or 1. it's only a boolean and not integer.




> Date: Wed, 21 Nov 2007 16:27:35 +0100
> From: pixpush@gmail.com
> To: lua@bazar2.conectiva.com.br
> Subject: Re: luaL_dofile() returns LUA_YIELD ?
>
> 2007/11/21, Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br>:
> > > can anyone plase point me to documented cases where luaL_dofile() returns a
> > > LUA_YIELD error code ?
> >
> > http://www.lua.org/manual/5.1/manual.html#luaL_dofile says luaL_dofile only
> > returns 0 or 1.
> >
>
>
> I was also reading that lua_pcall returns error codes defined in
> lua.h, such as: LUA_ERRRUN,LUA_ERRMEM, LUA_ERRERR...
>
> Since in lua.h the code LUA_YIELD is defined along with those others,
> and since luaL_dofile si defined as: (luaL_loadstring(L, str) ||
> lua_pcall(L, 0, LUA_MULTRET, 0))
> I was wondering if it's actually lua_pcall returning the error
> code...and thus poss ibly returning LUA_YIELD. (?!)
>
> I'm asking because I'm using no coroutines at all, and because
> apparently LUA_YIELD looks mainly like a coroutine-type error code
> (?!).
>
> Using 5.1.2, btw.



比尔盖茨的电脑里刚刚安装的软件――新一代的Windows Live 2.0! 立刻体验!