[Tarantool-patches] [RFC 3/4] cfg: prepare symbolic evaluation of replication_synchro_quorum

Cyrill Gorcunov gorcunov at gmail.com
Thu Nov 26 17:44:22 MSK 2020


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!


More information about the Tarantool-patches mailing list