コード例 #1
0
ファイル: State.go プロジェクト: rdlaitila/leaf
// 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}
}
コード例 #2
0
ファイル: state.go プロジェクト: halturin/luajit
// 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}
}