[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: abs_index
- From: David Jones <drj@...>
- Date: Wed, 29 Sep 2004 14:28:55 +0100
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.