[Tarantool-patches] [PATCH rfc] lua: expose luaL_serializer to Lua

Igor Munkin imun at tarantool.org
Thu Feb 20 14:23:59 MSK 2020


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(-)
> 

<snipped>

> -- 
> 2.20.1 (Apple Git-117)
> 

[1]: https://lists.tarantool.org/pipermail/tarantool-patches/2020-February/014304.html

-- 
Best regards,
IM


More information about the Tarantool-patches mailing list