shared/main.c

#include <libguile.h>
#include "main.h"

static SCM plus (SCM a, SCM b)
{
  return scm_from_int((int) Plus(scm_to_int(a),
                                 scm_to_int(b)));
}

static void ready(void *data, int argc, char **argv)
{
  scm_c_define_gsubr("plus", 2, 0, 0, plus);
  scm_shell(argc, argv);
}

int main(int argc, char **argv)
{
  scm_boot_guile(argc, argv, ready, 0);
  return 0;
}