lua-users home
lua-l archive

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

On Sep 28, 2004, at 21:07, Roberto Ierusalimschy wrote:

  #define abs_index(L, i) \
	((i) > 0 || (i) <= LUA_REGISTRYINDEX ? (i) : \
	lua_gettop(L) + (i) + 1)

 How about including it into the lauxlib.h or maybe lua.h?

The problem is that it uses `i' several times. For a generic,
"official" macro, this is not too polite.

How about a function then? The functionality is useful. I agree that you wouldn't want to bless macros like this.

David Jones