Lua Five Three |
|
Summaries of differences between 5.2 and 5.3 can be found here:
Announcements:
Areas affected also described on the wiki include
string.dump
http://www.lua.org/work/doc/manual.html#pdf-string.dump strip
would be usable in LuaCompilerInLua and was previously in LuaJit.
Other areas this page might address: LuaJIT? and LuaImplementations? IDE support?
table.move (a1, f, e, t [,a2])
http://www.lua.org/work/doc/manual.html#pdf-table.move
This new function does a copy of a range of values.
Design-wise, this function bears some resemblance to the C memmove
[1] function but is not implemented in terms of it. The source and destination ranges may overlap (unlike the C memcpy
).
table.move
provides a convenient way to clear (all or some of) an array too:
table.move(a, #a+1, 2*#a, 1)
table.move
was previously named table.copy
in 5.3.0(alpha).
table.move
is internally implemented with lua_geti
/lua_seti
[2][3] or (if t
lacks __index
/__newindex
metamethods) lua_rawgeti
/lua_rawseti
[4]/[5].
(See checktab
/aux_getn
and tmove
in ltablib.c
.)
void lua_rotate (lua_State *L, int idx, int n);
https://www.lua.org/manual/5.3/manual.html#lua_rotate
Discussions:
Observe lua.h definitions of lua_insert
and lua_remove
in terms of lua_rotate
:
#define lua_insert(L,idx) lua_rotate(L, (idx), 1) #define lua_remove(L,idx) (lua_rotate(L, (idx), -1), lua_pop(L, 1))
The readme says "arg table available to all code".
Discussions:
Discussions: