Ich bin mir fast sicher, Sie könnten diese Zahl erhöhen (8000 ) durch Ändern von LUAI_MAXCSTACK Wert in der luaconf.h Ihrer Umgebung und neu erstellen (Lua-Umgebung).
Standard ist, wie Sie bereits bemerkt haben:
/*
@@ 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
Nur wirkt es ein bisschen wie eine Pornographie.
Was ist mit der Verwendung einer Tabelle und der Iteration durch table.concat() Stücke von <=8000 Schlüssel?