In general, the syntax is:
for k, v in pairs(t) do .... end
equivalent to:
for k, v in next, t do .... end
But what if t has a __pairs __pairs ? Will the next() reference function be tested? If not, is it not better to always use pairs when iterating over tables and never call next() directly?
lua metatable meta-method
Siler
source share