From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Fang Newsgroups: gmane.lisp.guile.user Subject: Re: modules and C,C++ Date: Thu, 22 Mar 2007 19:19:57 -0500 (EST) Message-ID: <20070322190908.R48706-100000@shannon.csl.cornell.edu> References: <99336.1174522676123.JavaMail.root@web30> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: sea.gmane.org 1174609221 31993 80.91.229.12 (23 Mar 2007 00:20:21 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 23 Mar 2007 00:20:21 +0000 (UTC) Cc: guile-user@gnu.org To: Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Fri Mar 23 01:20:15 2007 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HUXVs-0007cN-SN for guile-user@m.gmane.org; Fri, 23 Mar 2007 01:20:13 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HUXXi-0005PZ-T0 for guile-user@m.gmane.org; Thu, 22 Mar 2007 19:22:06 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HUXXe-0005PL-Vs for guile-user@gnu.org; Thu, 22 Mar 2007 20:22:03 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HUXXd-0005Ol-HJ for guile-user@gnu.org; Thu, 22 Mar 2007 20:22:02 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HUXXd-0005Oi-El for guile-user@gnu.org; Thu, 22 Mar 2007 19:22:01 -0500 Original-Received: from shannon.csl.cornell.edu ([128.84.224.88]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HUXVm-00046L-GW for guile-user@gnu.org; Thu, 22 Mar 2007 20:20:06 -0400 Original-Received: from localhost (fang@localhost) by shannon.csl.cornell.edu (8.11.3/8.9.2) with ESMTP id l2N0Jvn49087; Thu, 22 Mar 2007 19:19:57 -0500 (EST) (envelope-from fang@shannon.csl.cornell.edu) X-Authentication-Warning: shannon.csl.cornell.edu: fang owned process doing -bs In-Reply-To: <99336.1174522676123.JavaMail.root@web30> X-detected-kernel: FreeBSD 2.0-4.2 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:5887 Archived-At: > .... > > What do I need to do to export my scm_c_define_gsubr'd > > functions to the module? Must I wrap them into another module in C, and > > use-module it? (Would I expect the same problem with mixing > > load-extensions with modules?) > > You will want to read about scm_c_export() and scm_c_call_with_current_module in http://www.gnu.org/software/guile/manual/html_node/Dynamic-Linking-and-Compiled-Code-Modules.html > and http://www.gnu.org/software/guile/manual/html_node/Accessing-Modules-from-C.html Thanks for the pointer. What I ended up doing was wrapping the scm_c_define_gsubr initialization routine (along with scm_c_export's) inside a scm_c_define_module("foo bar-primitives", ...) to distinguish the primitives from the non-primitives in a pure scheme module that calls the primitives. This way I don't end up throwing things into the default (guile-user) top module. Works quite well. Fang _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://lists.gnu.org/mailman/listinfo/guile-user