lua-users home
lua-l archive

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


22.05.2019, 20:55, "Jim" <djvaios@gmail.com>:
>>  I can't disagree about the inconvenience but this is the sort of change
>>  where the benefit is slight but the backwards incompatibility very painful.
>>  I normally either write a helper routine or use the pattern found in the
>>  Lua code itself:
>>  luaL_argerror(L, arg, lua_pushfstring(L, fmt, x, y));
>
> yes, this works. but isn't the lua_pushfstring function called again
> in the underlying lua_error() call ?

why not just add a new macro/function like - say -

int luaL_argerrorf ( lua_State * L, int arg, const char * fmt, ... )

(or luaL_f(unc)argerror) to Lua's C API ?