new macro luaL_opt to avoid evaluating defaults when no needed

This commit is contained in:
Roberto Ierusalimschy
2005-10-21 11:47:42 -02:00
parent 9f4211310f
commit 053e873145
5 changed files with 17 additions and 21 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: lauxlib.h,v 1.84 2005/08/26 17:36:32 roberto Exp roberto $
** $Id: lauxlib.h,v 1.85 2005/09/06 17:19:51 roberto Exp roberto $
** Auxiliary functions for building Lua libraries
** See Copyright Notice in lua.h
*/
@@ -114,6 +114,7 @@ LUALIB_API const char *(luaL_findtable) (lua_State *L, int idx,
#define luaL_getmetatable(L,n) (lua_getfield(L, LUA_REGISTRYINDEX, (n)))
#define luaL_opt(L,f,n,d) (lua_isnoneornil(L,(n)) ? (d) : f(L,(n)))
/*
** {======================================================