From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Volkan YAZICI Newsgroups: gmane.lisp.guile.user Subject: Re: Creating Modules within C Date: Mon, 20 Nov 2006 20:44:50 +0200 Message-ID: <20061120184449.GB1317@alamut> References: <20061116224812.GA1686@alamut> <87psbmnw7q.fsf@laas.fr> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1164048412 8006 80.91.229.2 (20 Nov 2006 18:46:52 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 20 Nov 2006 18:46:52 +0000 (UTC) Cc: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Nov 20 19:46:46 2006 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GmEA0-0001Dh-OD for guile-user@m.gmane.org; Mon, 20 Nov 2006 19:46:29 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GmEA0-0005ow-5v for guile-user@m.gmane.org; Mon, 20 Nov 2006 13:46:28 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GmE9c-0005lJ-A4 for guile-user@gnu.org; Mon, 20 Nov 2006 13:46:04 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GmE9b-0005jW-Ge for guile-user@gnu.org; Mon, 20 Nov 2006 13:46:03 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GmE9b-0005jE-DQ for guile-user@gnu.org; Mon, 20 Nov 2006 13:46:03 -0500 Original-Received: from [212.175.13.129] (helo=fep06.ttnet.net.tr) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GmE9a-0001aD-G7 for guile-user@gnu.org; Mon, 20 Nov 2006 13:46:03 -0500 Original-Received: from (unknown [192.168.8.106]) by AVGW-I-3.ttnet.net.tr with smtp id 1e07_5d71cf76_78c7_11db_8d21_001422175f4f; Mon, 20 Nov 2006 20:46:01 +0200 Original-Received: from alamut ([85.100.61.223]) by fep06.ttnet.net.tr with ESMTP id <20061120184559.DUGV28414.fep06.ttnet.net.tr@alamut>; Mon, 20 Nov 2006 20:45:59 +0200 Original-Received: from (dsl.dynamic8510061223.ttnet.net.tr [85.100.61.223]) by AVGW-I-6.ttnet.net.tr with smtp id 75a3_5c9f6522_78c7_11db_982b_0011433771ac; Mon, 20 Nov 2006 20:45:58 +0200 Original-To: Ludovic =?iso-8859-1?Q?Court=E8s?= Content-Disposition: inline In-Reply-To: <87psbmnw7q.fsf@laas.fr> User-Agent: Mutt/1.4.2.1i X-NAI-Spam-Rules: 1 Rules triggered BAYES_00=-2.5 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:5660 Archived-At: Hi, On Nov 17 12:34, Ludovic Courtès wrote: > Volkan YAZICI 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