[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Proposal: lua_getfield return the type of the value
- From: David Demelier <demelier.david@...>
- Date: Thu, 01 May 2014 09:21:12 +0200
Hi guys,
Some functions already return the type retrieved like lua_getuservalue,
lua_getglobal. It would be nice to have the same behavior for
lua_getfield. So one can easily do:
if (lua_getfield(L, -2, "x") == LUA_TNUMBER)
x = lua_tointeger(L, -1);
lua_pop(L, 1);
Kind regards,
David.