Exemplo n.º 1
0
// Converts the value at the given valid index to a Lua thread
// (represented as a *State). This value must be a thread; otherwise,
// the function returns nil.
func (this *State) Tothread(index int) *State {
	t := C.lua_tothread(this.luastate, C.int(index))
	if t == nil {
		return nil
	}
	return &State{luastate: t}
}
Exemplo n.º 2
0
// Converts the value at the given valid index to a Lua thread
// (represented as a *State). This value must be a thread; otherwise,
// the function returns nil.
func (s *State) Tothread(index int) *State {
	t := C.lua_tothread(s.l, C.int(index))
	if t == nil {
		return nil
	}
	return &State{t}
}