code: func (l *State) Replace(index int) {
  	l.checkElementCount(1)
  	l.move(index, l.stack[l.top-1])
  	l.top--
  }
docs: // Replace moves the top element into the given valid index without shifting
  // any element (therefore replacing the value at the given index), and then
  // pops the top element.
  //
  // http://www.lua.org/manual/5.2/manual.html#lua_replace