Zeeshan Ali wrote:
Hello,


It seems to survive 5 minutes of testing by me, but there could well be
problems lurking, so please test carefully in your context.


   I'll try to test it here as well but i'll have to convert it to an
equivalent C code first.

Out of interest, why is that? (It's easy enough to call Scheme-defined code from C, isn't it?)


BTW guys,

      I have been told that the fate of 'undefine' is in doubt. Is
that really true? Here is how i load modules and tell me if there is a
better way of doing the same:

1. load the module using scm_c_use_module ()
2. The module is responsible to define and export a few symbols (e.g
xchat-plugin-version)
3. I get the value of these symbols and
4 undefine these varriables

That sounds more complex and magic than it needs to be, to me - where by "complex" I mean your infrastructure code using undefine, and by "magic" I mean that it requires plugin authors to follow a non-code-enforced convention about the names of the variables. Why not use a registration API instead? In other words, instead of this:

(define (do-plugin-thing-1 ...) ...)
(define (do-plugin-thing-2 ...) ...)
...

do this:

(let ()
  (define (do-plugin-thing-1 ...) ...)
  (define (do-plugin-thing-2 ...) ...)
  ...
  (register-plugin do-plugin-thing-1
                   do-plugin-thing-2
                   ...))

This way there is no magic, and the visibility of the plugin bindings is under the control of the plugin author. Also, this way you could stay pure-R5RS if you like, as you don't really need any features of the module system.

Regards,
        Neil


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user

Reply via email to