lua-users home
lua-l archive

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

lauxlib.h has:

  #define luaL_optstring(L,n,d)  (luaL_optlstring(L, (n), (d), NULL))
  #define luaL_typename(L,i)     lua_typename(L, lua_type(L,(i)))

Why are there "(n)" / "(d)" / "(i)" instead of "n" / "d" / "i"? There
are commas around these letters so there shouldn't be a potential
precedence problem there, or am I wrong?

There are #define's there without parentheses:

  #define luaL_loadbuffer(L,s,sz,n)  luaL_loadbufferx(L,s,sz,n,NULL)

(Why am I asking this? Because I'll have to duplicate some of these
macros in my own code ('cos these macros aren't always present: not if
the various COMPAT macros aren't enabled), and I don't want them to
have a different style than my current code.)