[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: |
Marius Vollmer |
Subject: |
Re: [dev-serveez] Re: problem with module system in guile 1.6.x and post versions |
Date: |
01 Jun 2003 01:02:10 +0200 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 |
stefan <address@hidden> writes:
> 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?
Did you export your bindings? That is, did you call 'scm_c_export' in
C or did you use 'export' in Scheme?
> 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>'.
Think of the current module simply as a global (per-thread) variable.
The current module is not associated with a place in the code. It is
associated with a certain extent of time, like the values of all
global variables.
When a function is defined (more precisely, when a closure is
created), the current module (at the time of the definition) is
recorded in the lexical environment of the function. All non-local
variable references within that function are resolved with that
recorded module.
--
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3 331E FAF8 226A D5D4 E405