[tarantool-patches] Re: [PATCH v2 1/2] lua: new function luaT_return_error()
Alexander Turenko
alexander.turenko at tarantool.org
Thu Aug 1 11:35:39 MSK 2019
On Wed, Jul 31, 2019 at 07:00:44PM +0200, Vladislav Shpilevoy wrote:
>
>
> On 31/07/2019 18:20, Imeev Mergen wrote:
> >
> > On 7/31/19 6:40 PM, Vladislav Shpilevoy wrote:
> >>
> >> On 31/07/2019 17:23, Alexander Turenko wrote:
> >>>> +/**
> >>>> + * Return nil as the first return value and an error as the
> >>>> + * second. The error is received using box_error_last().
> >>>> + *
> >>>> + * @param L Lua stack.
> >>>> + */
> >>>> +LUA_API int
> >>>> +luaT_return_error(lua_State *L);
> >>> Maybe let the name be a bit more explicit, say,
> >>> luaT_push_conventional_error(struct lua_State *L)?
> >>>
> >> Please, no. You work too much with Java. The name
> >> is too long. Maybe luaT_push_nil_err()?
> > I thought that luaT_error() throws an error, and this one returns
> > it. So I called it luaT_return_error(). Should I change the name
> > to luaT_push_nil_err()?
> >
>
> For me 'return' was ok, but seems it is not ok for Kostja and
> Alexander. Lets wait.
We already have luaT_pusherror(). 'return' term triggers me here,
because we would use two terms for the same action.
luaT_push_nil_and_error() is okay for me: it is self-explanatory and
does not introduce a new term for an existing thing.
More information about the Tarantool-patches
mailing list