'__pairs' can also return a to-be-closed object

This commit is contained in:
Roberto I
2025-11-11 15:11:06 -03:00
parent 5b7d998764
commit 4cf498210e
3 changed files with 15 additions and 9 deletions

View File

@@ -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