Ejemplo n.º 1
0
Archivo: main.c Proyecto: songtzu/study
int 
main(int argc, char* argv[])
{
  char buf[128];

  if (argc < 2) {
    fprintf(stderr, "usage: runlisp [filename]\n");
    exit(-1);
  }

  sprintf(buf, "(load \"%s\")", argv[1]);
  fprintf(stdout, "%s\n", newlispEvalStr(buf));
  newlispEvalStr("(exit 0)");

  return 0;
}
Ejemplo n.º 2
0
int luaopen_newLISP(lua_State *L) {
   char * str = "()";
   newlispEvalStr(str);
   luaL_register(L, "newLISP", newLISP_lib);
   return 1;
}
Ejemplo n.º 3
0
static int newLISP_eval2(lua_State *L) {
   const char * str = lua_tostring(L, 1);
   const char * result = newlispEvalStr(str);
   lua_pushstring(L, result);
   return 1;
}