[Tarantool-patches] [PATCH 2/2] popen: add popen Lua module

Igor Munkin imun at tarantool.org
Mon Apr 20 14:57:42 MSK 2020


Sasha,

On 20.04.20, Alexander Turenko wrote:
> Thank you, Igor!
> 
> I made simple changes and postponed ones where I need a bit more time.
> Hope, you don't mind.

Totally OK with it.

> 
> Marked postponed questions as (postponed) in the email.
> 
> My answers are below.
> 
> WBR, Alexande Turenko.
> 

<snipped>

> 
> > > +static int
> > > +luaT_push_string_noxc(struct lua_State *L, char *str, size_t len)
> > > +{
> > > +	lua_pushcfunction(L, luaT_push_string_noxc_wrapper);
> > > +	lua_pushlightuserdata(L, str);
> > > +	lua_pushinteger(L, len);
> > > +	return luaT_call(L, 2, 1);
> > > +}
> > 
> > Minor: IMHO luaT_pushstring_* is more Lua-like naming.
> 
> It is from past agreements too: we discussed this with Vladimir D. and
> agreed to split 'foo' and 'bar' in 'lua*_foo_bar_baz()', when there is
> 'baz'. When there is no 'baz', it is 'lua*_foobar()'.

Are there any docs/guides/notes as a result of this discussion?

> 

<snipped>

> 
> > > +
> > > +		lua_getfield(L, 2, "timeout");
> > > +		if (!lua_isnil(L, -1) &&
> > > +		    (timeout = luaT_check_timeout(L, -1)) < 0.0)
> > > +			goto usage;
> > > +		lua_pop(L, 1);
> > 
> > Minor: I see this passage only in two similar places, so I propose to
> > move everything to a timeout-related helper.
> 
> luaT_check_timeout() is already this helper. Don't sure it worth to add
> one more wrapping level.

I mean you can also move there all table manipulations and checks.

> 

<snipped>

-- 
Best regards,
IM


More information about the Tarantool-patches mailing list