aboutsummaryrefslogtreecommitdiff
path: root/manual
diff options
context:
space:
mode:
authorRoberto I <roberto@inf.puc-rio.br>2025-11-11 15:11:06 -0300
committerRoberto I <roberto@inf.puc-rio.br>2025-11-11 15:11:06 -0300
commit4cf498210e6a60637a7abb06d32460ec21efdbdc (patch)
tree7b9cffee61083a6b256311917019b58a1fbdd42a /manual
parent5b7d9987642f72d44223a8e5e79e013bb2b3d579 (diff)
downloadlua-master.tar.gz
lua-master.tar.bz2
lua-master.zip
'__pairs' can also return a to-be-closed objectHEADmaster
Diffstat (limited to '')
-rw-r--r--manual/manual.of4
1 files changed, 2 insertions, 2 deletions
diff --git a/manual/manual.of b/manual/manual.of
index eaf0ce78..9b6976ca 100644
--- a/manual/manual.of
+++ b/manual/manual.of
@@ -6799,11 +6799,11 @@ In particular, you may set existing fields to nil.
6799@LibEntry{pairs (t)| 6799@LibEntry{pairs (t)|
6800 6800
6801If @id{t} has a metamethod @idx{__pairs}, 6801If @id{t} has a metamethod @idx{__pairs},
6802calls it with @id{t} as argument and returns the first three 6802calls it with @id{t} as argument and returns the first four
6803results from the call. 6803results from the call.
6804 6804
6805Otherwise, 6805Otherwise,
6806returns three values: the @Lid{next} function, the table @id{t}, and @nil, 6806returns the @Lid{next} function, the table @id{t}, plus two @nil values,
6807so that the construction 6807so that the construction
6808@verbatim{ 6808@verbatim{
6809for k,v in pairs(t) do @rep{body} end 6809for k,v in pairs(t) do @rep{body} end