code: func (l *State) ToInteger(index int) (int, bool) {
  	if n, ok := l.toNumber(l.indexToValue(index)); ok {
  		return int(n), true
  	}
  	return 0, false
  }
docs: // ToInteger converts the Lua value at index into a signed integer. The Lua
  // value must be a number, or a string convertible to a number.
  //
  // If the number is not an integer, it is truncated in some non-specified way.
  //
  // If the operation failed, the second return value will be false.
  //
  // http://www.lua.org/manual/5.2/manual.html#lua_tointegerx