This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Help: modules and -s switch
- To: Guile Mailing List <guile at sourceware dot cygnus dot com>
- Subject: Help: modules and -s switch
- From: Ian Grant <Ian dot Grant at cl dot cam dot ac dot uk>
- Date: Mon, 29 May 2000 17:52:37 +0100
- cc: Ian dot Grant at cl dot cam dot ac dot uk
I used to use (use-modules ...) to load my C module but now I use
(dynamic-call # (dynamic-link #)) instead because of the problem of putting
architecture dependent executables in $(datadir).
This works, except I don't know how to get the new definitions into the right
module because which module that is depends upon whether guile is being run
interactively (when it should be the guile-user module) or in command-line
mode with the '-s' option to run a script.
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?
Thanks
Ian
--
Ian Grant, Computer Lab., New Museums Site, Pembroke Street, Cambridge
Phone: +44 1223 334420 Personal e-mail: iang at pobox dot com