This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Help: modules and -s switch


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 



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]