> You can't code it directly, but many returns (and passing as varargs into
> another function) can be done like so:
> #!/usr/bin/env lua
> local function return_n(n)
> if n <= 0 then return end
> return n, return_n(n - 1)
> end
> print(select('#', return_n(3000)))
> --> 3000
> Testing on my Lua install shows that at least up to 300,000 works.
Thanks for the example you provided, it really made it obvious where to
look in the source code.
It seems I somehow missed the LUA_MULTRET case in 'moveresults':
> case LUA_MULTRET + 1:
> genmoveresults(L, res, nres, nres); /* we want all results */
> break;
Now I wonder why (how) is the number of results guaranteed to be at least 1000?
--
Jure