aboutsummaryrefslogtreecommitdiff
path: root/manual
diff options
context:
space:
mode:
Diffstat (limited to 'manual')
-rw-r--r--manual/manual.of23
1 files changed, 11 insertions, 12 deletions
diff --git a/manual/manual.of b/manual/manual.of
index 2e15839a..c69970d2 100644
--- a/manual/manual.of
+++ b/manual/manual.of
@@ -4253,12 +4253,8 @@ If the new top is greater than the old one,
4253then the new elements are filled with @nil. 4253then the new elements are filled with @nil.
4254If @id{index} @N{is 0}, then all stack elements are removed. 4254If @id{index} @N{is 0}, then all stack elements are removed.
4255 4255
4256For compatibility reasons, 4256This function can run arbitrary code when removing an index
4257this function may close slots marked as to-be-closed @see{lua_toclose}, 4257marked as to-be-closed from the stack.
4258and therefore it can run arbitrary code.
4259You should not rely on this behavior:
4260Instead, always close to-be-closed slots explicitly,
4261with @Lid{lua_closeslot}, before removing them from the stack.
4262 4258
4263} 4259}
4264 4260
@@ -4347,19 +4343,22 @@ otherwise, returns @id{NULL}.
4347@apii{0,0,m} 4343@apii{0,0,m}
4348 4344
4349Marks the given index in the stack as a 4345Marks the given index in the stack as a
4350to-be-closed @Q{variable} @see{to-be-closed}. 4346to-be-closed slot @see{to-be-closed}.
4351Like a to-be-closed variable in Lua, 4347Like a to-be-closed variable in Lua,
4352the value at that index in the stack will be closed 4348the value at that slot in the stack will be closed
4353when it goes out of scope. 4349when it goes out of scope.
4354Here, in the context of a C function, 4350Here, in the context of a C function,
4355to go out of scope means that the running function returns to Lua, 4351to go out of scope means that the running function returns to Lua,
4356there is an error, 4352or there is an error,
4353or the slot is removed from the stack through
4354@Lid{lua_settop} or @Lid{lua_pop},
4357or there is a call to @Lid{lua_closeslot}. 4355or there is a call to @Lid{lua_closeslot}.
4358An index marked as to-be-closed should neither be removed from the stack 4356A slot marked as to-be-closed should not be removed from the stack
4359nor modified before a corresponding call to @Lid{lua_closeslot}. 4357by any other function in the API except @Lid{lua_settop} or @Lid{lua_pop},
4358unless previously deactivated by @Lid{lua_closeslot}.
4360 4359
4361This function should not be called for an index 4360This function should not be called for an index
4362that is equal to or below an active to-be-closed index. 4361that is equal to or below an active to-be-closed slot.
4363 4362
4364Note that, both in case of errors and of a regular return, 4363Note that, both in case of errors and of a regular return,
4365by the time the @idx{__close} metamethod runs, 4364by the time the @idx{__close} metamethod runs,