This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: Help: modules and -s switch
- To: Ian Grant <Ian dot Grant at cl dot cam dot ac dot uk>
- Subject: Re: Help: modules and -s switch
- From: Marius Vollmer <mvo at zagadka dot ping dot de>
- Date: 30 May 2000 22:12:04 +0200
- Cc: Guile Mailing List <guile at sourceware dot cygnus dot com>
- References: <E12wSmM-0001Oz-00@wisbech.cl.cam.ac.uk>
Ian Grant <Ian.Grant@cl.cam.ac.uk> writes:
> Currently I have a scheme module (database postgres) that looks like this:
>
> (define-module (guile-user))
> (dynamic-call "init_postgres" (dynamic-link "libpostgres.so"))
> (define-module (database postgres))
> (define-public (other-parts-of-the-interface-written-in-scheme ....
>
> which only works for interactive sessions. How can I conditionally execute
> the '(define-module (guile-user))' appropriately? Or is there a specific
> top-level module for non-interactive guile?
Can you use something like this?
(define-module (database postgres))
(dynamic-call "init_postgres" (dynamic-link "libpostgres.so"))
(export primitive1 primitive2 ...)
(define-public (other-parts-of-the-interface-written-in-scheme ....
It is somewhat tedious to keep the `export' clause up to date, tho.