lua-users home
lua-l archive

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


On Mon, Nov 26, 2012 at 4:01 AM, Roberto Ierusalimschy
<roberto@inf.puc-rio.br> wrote:
>> > Isn't this enough?
>> >
>> >   luaL_error(L, "%s", lua_pushfstring(L, va_list))
>> >
>>
>> Not exactly since luaL_error prepends the where string as well (at least in
>> 5.1).  So a va_list version might take a level as well.
>
> I am afraid do not follow you here. The line above calls luaL_error,
> so it will prepend exactly the same stuff as a va_list version of
> luaL_error. The original luaL_error does not "take a level" (if I
> understood what you meant); if it did, the above line would take
> one as well.
>
> -- Roberto
>

I think what was being said is that the above construction wouldn't
work as a /function/.

But if you define it as a macro:

#define luaL_verror(L, p) luaL_error(L, "%s", lua_pushfstring(L, p))

Then you're fine.

/s/ Adam