#include #include #include static void *eval_string(void *str) { SCM module = scm_c_resolve_module("guile-user"); (void)scm_c_eval_string_in_module(str, module); return NULL; } static void *do_call_f(void *name) { SCM module = scm_c_resolve_module("test"); SCM proc_var = scm_c_module_lookup(module, name); SCM proc = scm_variable_ref(proc_var); (void)scm_call_0(proc); return NULL; } void *thread(void *arg) { (void)arg; scm_with_guile(do_call_f, "f"); return NULL; } int main(void) { pthread_t pt; scm_with_guile(eval_string, "(load \"scheme.scm\")"); pthread_create(&pt, NULL, thread, NULL); pthread_join(pt, NULL); return 0; }