|
Dirk Laurie <dirk.laurie@gmail.com>于2017年7月4日周二 下午12:38写道: > If lua can offer a C API like lua_clonetable would be better ?
Let's get this straight: you are not offering code that relies on
#include <lobject.h>
#include <ltable.h>And lgc.h lstate.h, I forgot call barrierback just now.as if doing so is kosher; you are merely providing proof-of-concept
code that the requested feature lua_clonetable is possible, right?
Yes.lua_clonetable can be implement by lua_next, but the performance would be must better. And I think it would be very useful.I remember Roberto said they were considering a table.clear function ( http://lua-users.org/lists/lua-l/2013-11/msg00669.html ) , we can use table.clone(tbl, {}) to instead of it.