Skip to content
Philipp Janda edited this page Mar 16, 2015 · 1 revision

pairs

The pairs function in Lua 5.2 and 5.3 respects a metamethod __pairs. The compatibility implementation for Lua 5.1 does the same, but since it is implemented in Lua in relies on debug.getmetatable (if available) or getmetatable to check for that metamethod. If debug.getmetatable is not available, this might not work for metatables containing a __metatable field.

Clone this wiki locally