| www.delorie.com/gnu/docs/guile/guile_134.html | search |
![]() Buy GNU books! | |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Smobs are Guile's mechanism for adding new non-immediate types to
the system.(5) To define a new smob type, the programmer provides Guile with
some essential information about the type -- how to print it, how to
garbage collect it, and so on -- and Guile returns a fresh type tag for
use in the first word of new cells. The programmer can then use
scm_c_define_gsubr to make a set of C functions that create and
operate on these objects visible to Scheme code.
(You can find a complete version of the example code used in this
section in the Guile distribution, in `doc/example-smob'. That
directory includes a makefile and a suitable main function, so
you can build a complete interactive Guile shell, extended with the
datatypes described here.)
| webmaster donations bookstore | delorie software privacy |
| Copyright © 2003 by The Free Software Foundation | Updated Jun 2003 |