guile-devel
[Top][All Lists]
Advanced

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

Re: What replaces scm_register_module_xxx (Doc update?)


From: rm
Subject: Re: What replaces scm_register_module_xxx (Doc update?)
Date: Thu, 8 Aug 2002 18:19:58 +0200
User-agent: Mutt/1.3.24i

On Thu, Aug 08, 2002 at 09:31:51AM -0500, Rob Browning wrote:
> "Dale P. Smith" <address@hidden> writes:
> 
> > The new method is to use a .scm file that defines the module,
> > dynamically loads the compiled code, and then exports whatever you
> > need.
> 
> Right.
> 
>   (define-module (foo bar))
>   (load-extension "libguile-foo-bar-v-1" "init_guile_foo_bar-v-1")
>   (export foo-1)
>   (export foo-2)
>   (export bar-1)
>   ...

I think there's a misunderstanding/misconception here (or, better:
in guile's current C api). The 'load-c-functions-through-scheme' 
aproach might be fine and all that's needed as long as we only want
to extend _guile_ (the application) with external libs. But guile
is inteded to be an embedded srcipting language as well (at least that's
what the documentation says). If i want my users to be able to script
some of my applications functionality there's no library i can load
with 'load-extension' -- of course i could put the tiny scm_* wrapper
functions into a dll and have _that_ loaded, but i wouldn't call this 
good design practise (oh, i could 'load-extension' my own application
instead, but that's not really portable ...). Having to provide (and
deploy!) scm file(s) just to be able to put my functions into different
modules feels clumsy. 
BTW, another problem i see (and face in mod_guile): with the above mentioned
approach it seems to be impossible for one dll to provide functions that
go into different modules. 

;; file: foo/strings
(define-module (foo strings))
 (load-extension "libguile-foo-bar-v-1" "init_guile_foo_bar-v-1")
   (export foo-1)
   (export foo-2)
   (export bar-1)

;; file: foo/utils
(define-module (foo utils))
 (load-extension "libguile-foo-bar-v-1" "init_guile_foo_bar-v-1")
   (export foo-4)
   (export foo-5)

Probably doesn't work as expected, or?

 Ralf Mattes



reply via email to

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