From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com [209.85.208.175]) (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 ED7B2469710 for ; Thu, 26 Nov 2020 17:44:25 +0300 (MSK) Received: by mail-lj1-f175.google.com with SMTP id i17so2627195ljd.3 for ; Thu, 26 Nov 2020 06:44:25 -0800 (PST) Date: Thu, 26 Nov 2020 17:44:22 +0300 From: Cyrill Gorcunov Message-ID: <20201126144422.GC1231860@grain> References: <20201119194100.840495-1-gorcunov@gmail.com> <20201119194100.840495-4-gorcunov@gmail.com> <1670ea9e-ebd6-771b-e3ec-d9edc97d461a@corp.mail.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1670ea9e-ebd6-771b-e3ec-d9edc97d461a@corp.mail.ru> Subject: Re: [Tarantool-patches] [RFC 3/4] cfg: prepare symbolic evaluation of replication_synchro_quorum List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mons Anderson Cc: tarantool-patches@dev.tarantool.org On Thu, Nov 26, 2020 at 05:38:32PM +0300, Mons Anderson wrote: > > For the formula evaluation I'd propose the following snippet: > > local expr = [[%s]] > local f, err = loadstring('return ('..expr..')') > if not f then error(string.format('Failed to load %%s: %%s',expr, err)) end > setfenv(f, { N = %d, math = math }) > return math.floor( f() ) Will do. And will address the rest of comments. Thanks for feedback!