func (state *State) CallMeta(index int, event string) bool {
	val := state.get(index)
	if meta := state.metafield(val, event); !IsNone(meta) {
		if cls, ok := meta.(*Closure); ok {
			state.frame().push(cls)
			state.frame().push(val)
			state.Call(1, 1)
			return true
		}
	}
	return false
}
CallMeta calls a metamethod.

If the object at index obj has a metatable and this metatable has a field event,
this function calls this field passing the object as its only argument. In this
case this function returns true and pushes onto the stack the value returned by
the call. If there is no metatable or no metamethod, this function returns false
(without pushing any value on the stack).

See https://www.lua.org/manual/5.3/manual.html#luaL_callmeta
package lua
import (
	"fmt"
	"io"
	"syscall"
)
func (state *State) ArgCheck(cond bool, arg int, msg string) {
	if !cond {
		state.ArgError(arg, msg)
	}
}
func (state *State) ArgError(arg int, msg string) int {
	return state.Errorf("bad argument #%d (%s)", arg, msg)
}
func (state *State) FileResult(err error, filename string) int {
	if err == nil {
		state.Push(true)
		return 1
	}
	state.Push(nil)
	if errStr := err.Error(); filename != "" {
		state.Push(fmt.Sprintf("%s: %s", filename, errStr))
	} else {
		state.Push(errStr)
	}
	if errno, ok := err.(syscall.Errno); ok {
		state.Push(int(errno))
	} else {
		state.Push(0)
	}
	return 3
}
func (state *State) ExecFrom(r io.Reader) error {
	return state.ExecChunk("?", r, BinaryMode|TextMode)
}
func (state *State) ExecText(text string) error {
	return state.ExecChunk("?", text, BinaryMode|TextMode)
}
func (state *State) ExecFile(file string) error {
	return state.ExecChunk(file, nil, BinaryMode|TextMode)
}
func (state *State) LoadFrom(r io.Reader) error {
	return state.LoadChunk("?", r, BinaryMode|TextMode)
}
func (state *State) LoadText(text string) error {
	return state.LoadChunk("?", text, BinaryMode|TextMode)
}
func (state *State) LoadFile(file string) error {
	return state.LoadChunk(file, nil, BinaryMode|TextMode)
}
func (state *State) NewMetaTable(name string) bool {
	if mt := state.GetMetaTable(name); mt != NilType && mt != NoneType {
		return false
	}
	state.Pop()
	state.NewTableSize(0, 2)
	state.Push(name)
	state.SetField(-2, "__name")  
	state.PushIndex(-1)
	state.SetField(RegistryIndex, name)  
	return true
}
func (state *State) GetSubTable(index int, field string) bool {
	if state.GetField(index, field) == TableType {
		return true  
	}
	state.Pop()                    
	index = state.AbsIndex(index)  
	state.NewTable()               
	state.PushIndex(-1)            
	state.SetField(index, field)   
	return false
}
func (state *State) GetMetaField(index int, event string) Type {
	meta := state.metafield(state.get(index), event)
	if !IsNone(meta) {
		state.Push(meta)
	}
	return meta.Type()
}
func (state *State) GetMetaTable(name string) Type {
	return state.GetField(RegistryIndex, name)
}
func (state *State) SetMetaTable(name string) {
	state.GetMetaTable(name)
	state.SetMetaTableAt(-2)
}