This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Anonymous C procedures in Guile


Martin Alonso Soto <masoto@uniandes.edu.co> writes:

> I have a set of C functions that I want to make visible from Guile in
> a somewhat unusual way (or so I think :-).  What I need is to create
> an alist (or a hash, I haven't decided yet) that associates each one
> of the C functions to a certain scheme object.  Of course, I can do
> that by registering the C functions in the global symbol table (using
> gh_new_procedure) and then moving them to the alist, but that would
> pollute the symbol table with a lot of names I don't need.

Well, you can use your strategy, and rest easy about name space
pollution, by using the guile module system.  If you put your
primitive procedures into their own module, you can control the
vsibility of the procedures.

I'd guess there is a way to do what you want more directly, that
takes more advantage of guile's internals.  I don't know if this
is an advantage, though ;^)

-russ