[Top][All Lists]

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

Re: [dev-serveez] Re: problem with module system in guile 1.6.x and pos

From: stefan
Subject: Re: [dev-serveez] Re: problem with module system in guile 1.6.x and post versions
Date: Sat, 31 May 2003 19:30:03 +0200 (CEST)

On 31 May 2003, Marius Vollmer wrote:

> Your current code will likely add the new binding to the
> '(guile-user)' module because that module is the current one by
> default.  In Guile 1.4, the core module '(guile)' was the default
> current module.  '(guile)' is automatically used by all other modules
> so you binding was automatically visible everywhere.
> I recommend to make a new module that contains all the c level serveez
> functions:
>   void
>   serveez_init_module_bindings (void *unused)
>   {
>     scm_c_define_gsubr ("serveez-version", ...);
>     scm_c_define_gsubr ("bar", ...);
>     ...
>     scm_c_export ("serveez-version", "bar", ..., NULL);
>   }
>   void
>   serveez_create_module ()
>   {
>     scm_c_define_module ("serveez builtin",
>                          serveez_init_module_bindings, NULL);
>   }
> Then use that module where you need it:
>   (define-module (test-suite)
>     :use-module (serveez builtin))
>   (define (test)
>     ...
>     (serveez-version)
>     ...)

Hm.  This somehow implies that

   (define-module (test-suite)
     :use-module (guile-user))

would be sufficient to solve the problem.  But in fact in does not.  Why
is this?

Even more confusing is that

  (display (current-module))

tells me '#<directory (test-suite) 80cb260>' outside functions (e.g. right
behind the (define-module ...) thingie).  But in a function exported by
the (test-suite) it tells me '#<directory (guile-user) 80cc500>'.

BTW: I am testing with Guile 1.6.3, if that matters...

Thanks in advance,

reply via email to

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