[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
4.4.4 What learn1 is doing
If you compare learn1 to learn0, you will find that learn1 uses a new
Guile construct: the function gh_new_procedure()
, and its
siblings:
/* now try to define some new builtins, coded in C, so that they are
available in Scheme. */
gh_new_procedure1_0("c-factorial", c_factorial);
gh_new_procedure1_0("c-sin", c_sin);
gh_new_procedure1_0("v-t", vector_test);
|
It is clear that gh_new_procedure()
adds a new builtin
routine written in C which can be invoked from Scheme. We can now
revise our checklist for programming with libguile, so it includes
adding callbacks.
|
I breezed by the issue of how to write your C routines that are registered to be called from Scheme. This is non-trivial, and is discussed at length in the Guile Programmer's Manual.