guile-user
[Top][All Lists]
Advanced

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

Re: Creating Modules within C


From: Volkan YAZICI
Subject: Re: Creating Modules within C
Date: Mon, 20 Nov 2006 20:44:50 +0200
User-agent: Mutt/1.4.2.1i

Hi,

On Nov 17 12:34, Ludovic Courtès wrote:
> Volkan YAZICI <address@hidden> writes:
> > Within scm_eval(), I need to use a very simple module:
> >
> >   (define-module ultra-complex-thingy #:pure)
> >
> > (Yeah, that's the complete source code of my module.) The problem is,
> > how can I create and use that module within my C code, in scm_eval()?
> > Any assistance will be really appreciated.
> 
> You could write a piece of Scheme to create the relevant module.
> Namely, you could start with something like this:
> 
>   (let ((m (make-module)))
>     (module-use-interfaces! m
>                             (module-public-interface the-root-module)))
> 
> And then bind that to some variable accessible from C (or pass it to a
> Scheme procedure written in C that will just store it in a C variable
> that you can later access).

First, thanks so much for your answer. But I couldn't find any
documentation about the above make-module, module-use-interfaces! and
module-use-interfaces functions used. I looked at the source code but,
because of I'm totally green about module related stuff, couldn't figure
out anything significant.

I don't want to be lazy but... Can you please explain a bit more about
the above usage of modules? For instance, you said, I can bind that
[thing] to some variable in C. But then how will I use it?

[I'm not sure if this will be a useful information, but anyway:] I just
want to execute my individual procedures in a #:pure'ified environment
in PL/scheme. That's all. I hope I'm on the right direction.


Regards.




reply via email to

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