|
Iterators are not bound to for loops.for k, v in ipairs( t )doprint(k, v )endis syntactic sugar for:local it = ipairs( t )local k, v = it( t, 0 )while k ~= nildoprint(k, v )k, v = it( t, k )endis syntactic sugar for:local it = ipairs( t )local k, vk, v = it( t, 0 )::loop::print(k, v )k, v = it( t, k )if( k ~= nil )thengoto loopend