unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Volkan YAZICI <yazicivo@ttnet.net.tr>
Cc: guile-user@gnu.org
Subject: Re: Creating Modules within C
Date: Mon, 20 Nov 2006 20:44:50 +0200	[thread overview]
Message-ID: <20061120184449.GB1317@alamut> (raw)
In-Reply-To: <87psbmnw7q.fsf@laas.fr>

Hi,

On Nov 17 12:34, Ludovic Courtès wrote:
> Volkan YAZICI <yazicivo@ttnet.net.tr> 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.


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


  reply	other threads:[~2006-11-20 18:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-16 22:48 Creating Modules within C Volkan YAZICI
2006-11-17 11:34 ` Ludovic Courtès
2006-11-20 18:44   ` Volkan YAZICI [this message]
2006-11-22 17:43     ` Ludovic Courtès
2006-11-22 21:08       ` Volkan YAZICI

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061120184449.GB1317@alamut \
    --to=yazicivo@ttnet.net.tr \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).