[tarantool-patches] Re: [PATCH 5/5] box/console: Provide console.eos() api

Cyrill Gorcunov gorcunov at gmail.com
Tue Sep 3 22:19:16 MSK 2019


On Tue, Sep 03, 2019 at 10:00:57PM +0300, Konstantin Osipov wrote:
> * Cyrill Gorcunov <gorcunov at gmail.com> [19/08/31 00:51]:
> >  
> > +local function console_eos(...)
> 
> Please add a comment.

OK

> > +    if not ... then
> > +        return tostring(current_eos())
> > +    end
> > +    -- We can't allow to change yaml eos format because
> > +    -- it is a part of encoding standart, thus permit
> > +    -- only for modes where it is safe.
> > +    local d = current_output()
> > +    if d["fmt"] == "lua" then
> > +        output_eos["lua"] = ...
> 
> Why do you need variadic arguments here?

because this function is get/set, it might be
called without arguments to fetch current eos
setting, and with argument to setup new eos.




More information about the Tarantool-patches mailing list