static SCM call_callable(SCM scm_args) { SCM stack = scm_make_stack(SCM_BOOL_T, SCM_EOL); SCM frame = scm_stack_ref(stack, scm_from_int(0)); SCM proc = scm_frame_procedure(frame); PyObject *callable = scm_to_pointer(scm_assq_ref(gsubr_alist, proc)); scm_dynwind_begin(0); PyObject *py_args = scm2py(scm_args); if (py_args == NULL) py2scm_exception(); /* does not return */ scm_dynwind_py_decref(py_args); struct call_callable_data data = { callable, py_args }; PyObject *py_result = (PyObject *)scm_without_guile( (void *(*)(void *))call_callable1, &data); if (py_result == NULL) py2scm_exception(); /* does not return */ scm_dynwind_py_decref(py_result); SCM scm_result = py2scm(py_result); scm_dynwind_end(); return scm_result; }
void scm_i_frame_print (SCM frame, SCM port, scm_print_state *pstate) { scm_puts_unlocked ("#<frame ", port); scm_uintprint (SCM_UNPACK (frame), 16, port); scm_putc_unlocked (' ', port); scm_write (scm_frame_procedure (frame), port); /* don't write args, they can get us into trouble. */ scm_puts_unlocked (">", port); }