From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 1906C469719 for ; Thu, 20 Feb 2020 14:29:21 +0300 (MSK) Date: Thu, 20 Feb 2020 14:23:59 +0300 From: Igor Munkin Message-ID: <20200220112359.GE404@tarantool.org> References: <20200204090017.97814-1-arkholga@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200204090017.97814-1-arkholga@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH rfc] lua: expose luaL_serializer to Lua List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Olga Arkhangelskaia Cc: tarantool-patches@dev.tarantool.org Olya, Thanks for the patch, but since we reverted the commit introducing __pairs metamethod for userdata[1] I guess this approach can't replace the existing behaviour. On 04.02.20, Olga Arkhangelskaia wrote: > There are several modules in Lua allowing to transform data from one format to > another (yaml, msgpack, json). They are configured via cfg method. The options > are parts of struct luaL_serializer object in C. That method used to be > implemented via additional table on Lua stack and overriden __call metamethod. > Such implementation had hudge shortcoming: any field could be > changed/added via raw modification. And such change was not visible for > tarantool. > To leave the only one source of information/configuration possibility cfg table > was changed to userdata with index, newindex, pairs, call and serialize > metamethods. And the interface was remained unchanged. > Closes #4521 > --- > Branch: https://github.com/tarantool/tarantool/tree/OKriw/gh-4521-lua-serializers-should-use-FFI-to-check-and-set-options > src/lua/utils.c | 193 +++++++++++++++++++++++++++++++++++++++--------- > 1 file changed, 160 insertions(+), 33 deletions(-) > > -- > 2.20.1 (Apple Git-117) > [1]: https://lists.tarantool.org/pipermail/tarantool-patches/2020-February/014304.html -- Best regards, IM