guile-user
[Top][All Lists]
Advanced

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

Re: How to select a module in C (guile 1.3.4)


From: Marius Vollmer
Subject: Re: How to select a module in C (guile 1.3.4)
Date: 18 Jun 2001 14:51:59 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.0.102

Richard Guenther <address@hidden> writes:

> I managed to create a new module (and thereby making it active) by
> gh_eval("(define-module (glame))"); But still I fail to somehow
> "import" the scm module (I.e. call-with-current-continuation) -
> I worked around that by doing

Hmm, I'm still unclear about what you want to accomplish exactly.  Can
you show the complete code so that I can run it and see how it fails?
I hope that there is a different way to get the things done that you
need without relying on accessing the module system from C.

What version of Guile do you need to use?  1.3.4?  Could you use 1.4
or a recent CVS version?

> Still I have the problem that the console interface to our program
> (uses scm_shell()) differs from the GUI one (a text view widget and
> a simple line edit, calls gh_eval_str() from the line edit "ENTER"
> signal) - with scm_shell() the active module and the use-module
> stuff gets overridden.

Yes, that's part of what scm_shell (more precisely top-repl) does.  We
already discovered that this is not what all people might want... as a
drastic stop-gap measure, you might want to copy top-repl out of
boot-9.scm and modify it to suit your needs.

On the other hand, you might also just let the repl run in
(guile-user) and make your additional features available in that
module.  I do that in a simulator of mine:

    (define (sim-repl)
      (let ((guile-user (resolve-module '(guile-user))))
        (module-use! guile-user (resolve-interface '(gossip sim)))
        ... more setup stuff ...
        (set-repl-prompt! "gossip> ")
        (top-repl)))



reply via email to

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