本文整理汇总了Golang中C.lua_setmetatable函数的典型用法代码示例。如果您正苦于以下问题:Golang lua_setmetatable函数的具体用法?Golang lua_setmetatable怎么用?Golang lua_setmetatable使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了lua_setmetatable函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: Setmetatable
// Pops a table from the stack and sets it as the new metatable for the
// value at the given valid index.
func (this *State) Setmetatable(index int) int {
return int(C.lua_setmetatable(this.luastate, C.int(index)))
}
示例2: SetMetaTable
// lua_setmetatable
func (L *State) SetMetaTable(index int) {
C.lua_setmetatable(L.s, C.int(index))
}
示例3: Setmetatable
// Pops a table from the stack and sets it as the new metatable for the
// value at the given valid index.
func (s *State) Setmetatable(index int) int {
return int(C.lua_setmetatable(s.l, C.int(index)))
}