guile-user
[Top][All Lists]
Advanced

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

Re: guile 1.4 module system


From: Thien-Thi Nguyen
Subject: Re: guile 1.4 module system
Date: Sat, 15 Sep 2001 03:40:07 -0400

   From: Alex Schroeder <address@hidden>
   Date: Sat, 15 Sep 2001 00:02:32 +0200

   The most important question to me now is wether I have used the
   module system as it ought to be used.

check out the "modules" chapter in the guile reference manual,
specifically section "the guile module system".  there are instructions
there on how to use `define-module' and `use-modules', the two principal
special forms you need to grok.  if the documentation is unclear in some
way, that's a bug -- please report the problem to address@hidden

   Remember that admin.scm will use two modules that export the same
   names.  The question is therefore how will I access these?

keep an eye out for the `:renamer' clause in the documentation.  another
approach is to use generic functions.  (from my brief understanding of
your situation, g.f. might actually be the better approach.)  see also
http://www.glug.org/people/ttn/guile-projects/ for an implementation of
similar "rendering mux" feature.

   There is no relationship between the module name and the file name,
   right?  (As in Emacs require, for example.)

there is indeed a relationship: module `(a b c)' is expected in file
a/b/c.scm somewhere under `%load-path'.  see also `%load-extensions'.

   How can I tell Guile what namespace to use when loading a file, then?

see Marius Vollmer's recent implementation of `runtime-use-modules' for
a way to do this.  keep in mind that there is always the concept of
"current module" (analogous to cwd for filesystem access) -- when you do
`use-modules', it is the current module that gains access.

thi



reply via email to

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