C API、lua_concat()
/* * $ gcc -Wall -W -I/usr/include/lua50 -o 2008102500 -llua50 2008102500.c */ #include <stdio.h> #include <lua.h> int main(void) { lua_State *L; L = lua_open(); lua_pushstring(L, "foo"); lua_pushstring(L, " bar"); lua_pushstring(L, " baz"); lua_concat(L, 3); printf("%s\n", lua_tostring(L, -1)); lua_concat(L, 0); printf("*%s*\n", lua_tostring(L, -1)); lua_close(L); return 0; }
で、
foo bar baz **