guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating modules from C (was: On the deprecated auto-loading of comp


From: NIIBE Yutaka
Subject: Re: Creating modules from C (was: On the deprecated auto-loading of compiled-code modules)
Date: Tue, 15 May 2001 09:07:49 +0900 (JST)

Matthias Koeppe wrote:
 > Thanks for all the useful explanations and suggestions.

Yes.  Thanks Martin for concrete example. 

 > I had actually hoped there was a cleaner way to do module creation
 > _and_ symbol export from the C level; the call to `module-export!' is
 > a bit strange.  (It looks as if it might change without notice in
 > later versions, and I would like to use the Recommended,
 > Never-Changing-Again method to deal with modules for SWIG.)
 > 
 > Even a very thin layer of C code would help a lot here; I would
 > suggest adding a function `scm_module_export_x(SCM module, SCM
 > list_of_symbols)' to `modules.h'.  What do others think?

I have another thought.  We discuss Scheme binding so far, but there's
C binding too.  It would be good if we have consistent handling
between:

        The symbol name space in Scheme
        The symbol name space in C

Currently, if we have an external symbol in the objects written in C,
it is visible for other modules, that is, it pollutes the symbol name
space.  In general (on Unix), the symbol name space is per executable,
while Guile supports the symbol name space (in Scheme) per module.

With libtool, we could implement something like per module name space,
having module prefix in symbols and using header file for `binding'.
For example, a symbol "car" in module "m" becomes "m_LTX_car", and
header file has the `binding' of car --> m_LTX_car:
        #define car m_LTX_car

The module which uses module "m" accesses "m_LTX_car" with "car".
Basically, (use-module ...) corresponds #include "...".

That's my thought on Guile module programming in C.  Your comments are
welcome.
-- 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]