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 D586B2461C for ; Wed, 4 Sep 2019 08:51:26 -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 Oz7Wd1_2Zb8n for ; Wed, 4 Sep 2019 08:51:26 -0400 (EDT) Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id D6CE224D65 for ; Wed, 4 Sep 2019 08:50:55 -0400 (EDT) Received: by mail-lj1-f193.google.com with SMTP id h3so12650669ljb.5 for ; Wed, 04 Sep 2019 05:50:55 -0700 (PDT) Date: Tue, 3 Sep 2019 22:19:16 +0300 From: Cyrill Gorcunov Subject: [tarantool-patches] Re: [PATCH 5/5] box/console: Provide console.eos() api Message-ID: <20190903191916.GM2801@uranus.lan> References: <20190830214808.17422-1-gorcunov@gmail.com> <20190830214808.17422-6-gorcunov@gmail.com> <20190903190057.GD15611@atlas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190903190057.GD15611@atlas> 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: Konstantin Osipov Cc: tml , Alexander Turenko , Kirill Yukhin On Tue, Sep 03, 2019 at 10:00:57PM +0300, Konstantin Osipov wrote: > * Cyrill Gorcunov [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.