'__pairs' can also return a to-be-closed object
This commit is contained in:
1 parent
5b7d998764
commit
4cf498210e
3 files changed
+15
-9
No files matched your search
+2
-2
@@ -6799,11 +6799,11 @@ In particular, you may set existing fields to nil.
|
||||
@LibEntry{pairs (t)|
|
||||
|
||||
If @id{t} has a metamethod @idx{__pairs},
|
||||
calls it with @id{t} as argument and returns the first three
|
||||
calls it with @id{t} as argument and returns the first four
|
||||
results from the call.
|
||||
|
||||
Otherwise,
|
||||
returns three values: the @Lid{next} function, the table @id{t}, and @nil,
|
||||
returns the @Lid{next} function, the table @id{t}, plus two @nil values,
|
||||
so that the construction
|
||||
@verbatim{
|
||||
for k,v in pairs(t) do @rep{body} end
|
||||
|
||||
Reference in new issue
Block a user