AFAICS, the numeric for is simply a syntactical convenience which
allows
loops like this:
The generic for loop is also a syntactical convenience (although
generic for and numeric for both use dedicated opcodes in the VM
rather than the ones used by while/until loops).
I'm not sure why you'd want or need to implement a numeric for
using a
generic for (as you seem to want to do), though you can if you wish
(just
not in the way you propose).
It simply seems inconsistent that a numeric for loop is the only place
in Lua where a function call or vararg at the end of the expression
list is not expanded to the number of returned results;
a,b = f()
t = {a, b, f()}
f(a, b, f())
for a,b in f() do
for a = b, f() do -- The second return value of f(), if there is one,
is discarded