lua-users home
lua-l archive

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


"Pixel Pusher" <pixpush@gmail.com> writes:

> 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 possibly returning LUA_YIELD. (?!)

The short circuit C operator || returns only 0 and 1 (in my book a
design mistake, but relevant here).

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum