From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id B5C5924D48 for ; Thu, 1 Aug 2019 04:35:55 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id t1SH3dtpAZjE for ; Thu, 1 Aug 2019 04:35:55 -0400 (EDT) Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 0B26B24C54 for ; Thu, 1 Aug 2019 04:35:54 -0400 (EDT) Date: Thu, 1 Aug 2019 11:35:39 +0300 From: Alexander Turenko Subject: [tarantool-patches] Re: [PATCH v2 1/2] lua: new function luaT_return_error() Message-ID: <20190801083538.pvod64ov6mxijn67@tkn_work_nb> References: <20190731152324.4rraz2shvqnenaas@tkn_work_nb> <5abcd784-f790-5675-fae0-1620e264a221@tarantool.org> <4927f71a-2141-4412-6298-0c48b28b25ec@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: Vladislav Shpilevoy Cc: Imeev Mergen , tarantool-patches@freelists.org, kostja@tarantool.org 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.