Jeg er næsten sikker på, at du kan øge det tal (8000 ) ved at ændre LUAI_MAXCSTACK værdi i dit miljøs luaconf.h og genopbygge det (Lua-miljø).
Standard en er, som du allerede har bemærket:
/*
@@ LUAI_MAXCSTACK limits the number of Lua stack slots that a C function
@* can use.
** CHANGE it if you need lots of (Lua) stack space for your C
** functions. This limit is arbitrary; its only purpose is to stop C
** functions to consume unlimited stack space. (must be smaller than
** -LUA_REGISTRYINDEX)
*/
#define LUAI_MAXCSTACK 8000
Kun det ligner en pornografi en smule.
Hvad med at bruge en tabel og iterere gennem table.concat() bidder af <=8000 nøgler?