#include "all.h"

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

bool guile_hook(char * name, SCM params) {
  SCM var = scm_defined_p
    (scm_string_to_symbol
     (scm_from_utf8_string(name)), SCM_UNDEFINED);
  // Bound, call it
  if (scm_from_bool(var)) {
    SCM hook = scm_variable_ref(scm_c_lookup(name));
    /* if (scm_is_true(hook)) { */
    /* } */
    return scm_to_bool(scm_call_1(hook, params));
  }
  return true;
}
