From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Sergey Voinov <sergeiv@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH] Add console.print() alias for box.session.push()
Date: Thu, 5 Dec 2019 19:16:21 +0300 [thread overview]
Message-ID: <20191205161621.GA2469@uranus> (raw)
In-Reply-To: <20191205155306.13157-1-sergeiv@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.
next prev parent reply other threads:[~2019-12-05 16:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-05 15:53 Sergey Voinov
2019-12-05 16:16 ` Cyrill Gorcunov [this message]
2019-12-16 23:54 ` Alexander Turenko
2019-12-17 14:11 ` Alexander Turenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191205161621.GA2469@uranus \
--to=gorcunov@gmail.com \
--cc=sergeiv@tarantool.org \
--cc=tarantool-patches@dev.tarantool.org \
--subject='Re: [Tarantool-patches] [PATCH] Add console.print() alias for box.session.push()' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox