You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some functions in the Ziglua API have a doc string that forgets to mention that the function pops from the stack. IMO this information is pretty useful when developing bindings.
/// Does the equivalent to t[`k`] = v where t is the value at the given `index`
/// and v is the value on the top of the stack
/// See https://www.lua.org/manual/5.4/manual.html#lua_setfield
pub fn setField(lua: *Lua, index: i32, k: [:0]const u8) void {
c.lua_setfield(@ptrCast(lua), index, k.ptr);
}
In lua docs:
Does the equivalent to t[k] = v, where t is the value at the given index and v is the value on the top of the stack.
This function pops the value from the stack. As in Lua, this function may trigger a metamethod for the "newindex" event (see [§2.4](https://www.lua.org/manual/5.4/manual.html#2.4)).
/// Does the equivalent to t[k] = v, where t is the value at the given `index`
/// v is the value on the top of the stack, and k is the value just below the top
/// See https://www.lua.org/manual/5.4/manual.html#lua_settable
pub fn setTable(lua: *Lua, index: i32) void {
c.lua_settable(@ptrCast(lua), index);
}
In lua docs:
Does the equivalent to t[k] = v, where t is the value at the given index, v is the value on the top of the stack, and k is the value just below the top.
This function pops both the key and the value from the stack. As in Lua, this function may trigger a metamethod for the "newindex" event (see [§2.4](https://www.lua.org/manual/5.4/manual.html#2.4)).
/// Pushes onto the stack the value t[k] where t is the value at the given index and k is the value on the top of the stack
/// Returns the type of the pushed value
/// See https://www.lua.org/manual/5.4/manual.html#lua_gettable
pub fn getTable(lua: *Lua, index: i32) LuaType {
In lua docs:
Pushes onto the stack the value t[k], where t is the value at the given index and k is the value on the top of the stack.
This function pops the key from the stack, pushing the resulting value in its place. As in Lua, this function may trigger a metamethod for the "index" event (see [§2.4](https://www.lua.org/manual/5.4/manual.html#2.4)).
Returns the type of the pushed value.
The text was updated successfully, but these errors were encountered:
Just noting this here before I forget:
Some functions in the Ziglua API have a doc string that forgets to mention that the function pops from the stack. IMO this information is pretty useful when developing bindings.
The text was updated successfully, but these errors were encountered: