code: func (l *State) ToValue(index int) interface{} {
  	v := l.indexToValue(index)
  	switch v := v.(type) {
  	case string, float64, bool, *table, *luaClosure, *goClosure, *goFunction, *State:
  	case *userData:
  		return v.data
  	default:
  		return nil
  	}
  	return v
  }
docs: // ToValue convertes the value at index into a generic Go interface{}.  The
  // value can be a userdata, a table, a thread, a function, or Go string, bool
  // or float64 types. Otherwise, the function returns nil.
  //
  // Different objects will give different values.  There is no way to convert
  // the value back into its original value.
  //
  // Typically, this function is used only for debug information.
  //
  // http://www.lua.org/manual/5.2/manual.html#lua_tovalue