From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-f65.google.com (mail-lf1-f65.google.com [209.85.167.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 35BEC46971A for ; Thu, 5 Dec 2019 19:16:25 +0300 (MSK) Received: by mail-lf1-f65.google.com with SMTP id v201so2898965lfa.11 for ; Thu, 05 Dec 2019 08:16:25 -0800 (PST) Date: Thu, 5 Dec 2019 19:16:21 +0300 From: Cyrill Gorcunov Message-ID: <20191205161621.GA2469@uranus> References: <20191205155306.13157-1-sergeiv@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191205155306.13157-1-sergeiv@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH] Add console.print() alias for box.session.push() List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Sergey Voinov Cc: tarantool-patches@dev.tarantool.org On Thu, Dec 05, 2019 at 06:53:06PM +0300, Sergey Voinov wrote: > Currently, lack of a function like console.print() often confuses users. > This change adds such alias. > > Closes: #4393 > --- > issue: https://github.com/tarantool/tarantool/issues/4393 > branch: https://github.com/tarantool/tarantool/compare/servoin/gh-4393-console_print > src/box/lua/console.lua | 11 +++++++++++ > test/app-tap/console.test.lua | 25 ++++++++++++++++++++++++- > 2 files changed, 35 insertions(+), 1 deletion(-) > > diff --git a/src/box/lua/console.lua b/src/box/lua/console.lua > index d4d8ec984..05f8016c4 100644 > --- a/src/box/lua/console.lua > +++ b/src/box/lua/console.lua > @@ -821,6 +821,16 @@ local function listen(uri) > return s > end > > +-- > +-- Alias for box.session.push > +-- > +local function print(message, sync) > + if message == nil then > + error('Usage: console.print(message, sync)') > + end > + return box.session.push(message, sync or box.session.sync()) > +end Could you plase rename it to console_print() or similar since bare print() is already overloaded too much.