Concat concatenates the n values at the top of the stack, pops them, and leaves the result at the top. If n is 1, the result is the single value on the stack (that is, the function does nothing); if n is 0, the result is the empty string. Concatenation is performed following the usual semantic of Lu
(n int)
| 1207 | // |
| 1208 | // http://www.lua.org/manual/5.2/manual.html#lua_concat |
| 1209 | func (l *State) Concat(n int) { |
| 1210 | l.checkElementCount(n) |
| 1211 | if n >= 2 { |
| 1212 | l.concat(n) |
| 1213 | } else if n == 0 { // push empty string |
| 1214 | l.apiPush("") |
| 1215 | } // else n == 1; nothing to do |
| 1216 | } |
| 1217 | |
| 1218 | // Register sets the Go function f as the new value of global name. If |
| 1219 | // name was already defined, it is overwritten. |