Guile Reference Manual
13.1.1 Init Snarfing with guile-snarf
When writing C code for use with Guile, you typically define a set of C
functions, and then make some of them visible to the Scheme world by
scm_c_define_gsubr function; a C function published in
this way is called a subr. If you have many subrs to publish, it
can sometimes be annoying to keep the list of calls to
scm_c_define_gsubr in sync with the list of function definitions.
Frequently, a programmer will define a new subr in C, recompile the
application, and then discover that the Scheme interpreter cannot see
the subr, because of a missed call to
Guile provides the
guile-snarf command to manage this problem.
Using this tool, you can keep all the information needed to define the
subr alongside the function definition itself;
extract this information from your source code, and automatically
generate a file of calls to
scm_c_define_gsubr which you can
#include into an initialization function.