[Top][All Lists]

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

Re: [dev-serveez] guile modules

From: Thien-Thi Nguyen
Subject: Re: [dev-serveez] guile modules
Date: Fri, 07 Jun 2002 13:16:52 -0700

   From: stefan <address@hidden>
   Date: Fri, 7 Jun 2002 18:35:14 +0200 (CEST)

   This looks also useful.  But it does not help about the (export ...)

you're right.  i thought mgrabmue's hint was sufficient...

   I had a look at `ice-9/boot.scm' but could not find a good starting
   point... There is sooooo much about modules in it.  Any hint?

... but forgot that the module system is indeed a beast w/o well-defined
API, and not easy to understand via casual inspection, and was lost in
my own thoughts apparently.  be careful of getting old!

see below for a way to programmatically do an export given a list of
variable names (as strings) that are already defined in the current
module.  this approach uses eval and has been tested w/ "guile-1.4 -s".
a better approach would be to get a module system API defined and then
use that, but that's another story.


(define-module (MODULE-A))

(define pie "3.1415927")
(define api "one of these days")

(define to-be-exported '("pie" "api"))

(eval `(export ,@(map string->symbol to-be-exported)))

(define-module (MODULE-B)
  :use-module (MODULE-A))

(format #t "pie: ~A\napi: ~A\n" pie api)

reply via email to

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