From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Steve Tell Newsgroups: gmane.lisp.guile.user Subject: Re: primitive inclusion Date: Sat, 26 Jul 2003 00:23:16 -0400 (EDT) Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: main.gmane.org 1059193489 30919 80.91.224.249 (26 Jul 2003 04:24:49 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 26 Jul 2003 04:24:49 +0000 (UTC) Cc: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sat Jul 26 06:24:47 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19gGbv-00082X-00 for ; Sat, 26 Jul 2003 06:24:47 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19gGbk-0003Y1-4d for guile-user@m.gmane.org; Sat, 26 Jul 2003 00:24:36 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19gGb1-0003TT-99 for guile-user@gnu.org; Sat, 26 Jul 2003 00:23:51 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19gGaz-0003Pc-Bh for guile-user@gnu.org; Sat, 26 Jul 2003 00:23:49 -0400 Original-Received: from dsl093-240-080.ral1.dsl.speakeasy.net ([66.93.240.80] helo=telltronics.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19gGaY-0002za-Hy for guile-user@gnu.org; Sat, 26 Jul 2003 00:23:22 -0400 Original-Received: from localhost (tell@localhost) by telltronics.org (8.11.6/8.9.3) with ESMTP id h6Q4NGT31488; Sat, 26 Jul 2003 00:23:16 -0400 X-Sender: tell@ariel.lan.telltronics.org Original-To: "Peter S. Christopher" In-Reply-To: X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.user:2105 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:2105 On Fri, 25 Jul 2003, Peter S. Christopher wrote: > Hi listers, > > I'm having a problem finding a primitive function in one of my > modules. Here is the setup. I have a C program which (after > booting guile) defines a routine a-la: > > scm_c_define_gsubr("dvect?", 1, 0 ,0, dvect_p); > > Then the program loads a file using > > scm_c_primitive_load("root.scm"); > > > At the top of root.scm I include a module via: (use-modules (slab)) Now > within the text of the slab.scm I expect to use dcect?. However, the guile > cannot reference dvect? -- it can't find it. The problem is that dvect? is > being put in the (guile-user) module. And the slab module can't see it. > I've tried to (use-modules (guile-user)) and this seems to have no effect. > > Does anyone have any ideas how I can get it so that the slab module can > see dvect? ? I had similar problems trying to make a program compatible with both guile-1.5/1.6 and guile-1.4 - one of the differences between the two is which module C primitives end up in vs. the default module that scheme code runs in. I came up with this hack, placed immediately after initializing guile and before defining primitives to make guile-1.6 behave enough like 1.4: #ifdef HAVE_SCM_C_READ_STRING { SCM exp = scm_c_read_string("(define-module (guile))"); scm_primitive_eval_x(exp); } #endif While this works, making guile 1.6 behave like 1.4 isn't really the way to go any longer. I see that the guile-1.6.4 reference manual has a nice section "Accessing Modules from C." (thanks authors!) When writing a program for guile >= 1.6 only, it appears that one should use scm_c_define_module() to place their C primitives into the desired application-specfic module. Steve > Thanks for any help, > > Pete > > _______________________________________________ > Guile-user mailing list > Guile-user@gnu.org > http://mail.gnu.org/mailman/listinfo/guile-user > -- -- Steve Tell tell@telltronics.org _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://mail.gnu.org/mailman/listinfo/guile-user