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: Richard Guenther
Subject: Re: How to select a module in C (guile 1.3.4)
Date: Mon, 18 Jun 2001 15:29:43 +0200 (CEST)

On 18 Jun 2001, Marius Vollmer wrote:

> 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?

No, I'm forced to stay compatible with 1.3.4 which is still widely
used. But the C side seems to be "solved" and with your suggestion
below, I'm happy now :) (until the next question...)

> > 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)))

Hey, nice :) That helped a lot :)

Thanx, Richard.

--
Richard Guenther <address@hidden>
WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/
The GLAME Project: http://www.glame.de/




reply via email to

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