From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel,gmane.comp.gnu.lilypond.devel Subject: Re: %module-public-interface Date: Tue, 27 Apr 2010 22:34:18 +0200 Message-ID: References: <87zl1pv89p.fsf@gnu.org> <87d3ylv5oe.fsf@gnu.org> <4BB53617.7060700@hulin.org.uk> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1272400378 2783 80.91.229.12 (27 Apr 2010 20:32:58 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 27 Apr 2010 20:32:58 +0000 (UTC) Cc: "lilypond-devel@gnu.org" , guile-devel@gnu.org To: Ian Hulin Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Apr 27 22:32:56 2010 connect(): No such file or directory Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O6rSi-0006nA-Fa for guile-devel@m.gmane.org; Tue, 27 Apr 2010 22:32:56 +0200 Original-Received: from localhost ([127.0.0.1]:38836 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O6rSh-000150-N5 for guile-devel@m.gmane.org; Tue, 27 Apr 2010 16:32:55 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O6rSe-000146-Jj for guile-devel@gnu.org; Tue, 27 Apr 2010 16:32:52 -0400 Original-Received: from [140.186.70.92] (port=36197 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O6rSb-00012q-K6 for guile-devel@gnu.org; Tue, 27 Apr 2010 16:32:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O6rSZ-0004Ib-JV for guile-devel@gnu.org; Tue, 27 Apr 2010 16:32:49 -0400 Original-Received: from a-pb-sasl-quonix.pobox.com ([208.72.237.25]:37902 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O6rSZ-0004Fv-Gg; Tue, 27 Apr 2010 16:32:47 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 61A74AE7C3; Tue, 27 Apr 2010 16:32:23 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=sasl; bh=NEoh1vUzZEzZ SF5zerIvxLmG1tM=; b=rrOmRjK/NeJ5h6GURdTnHK3ns1uDweZ32PXgfKJrnaud bBJTrriklx3MQmpbzE+1sjZn2lzoEVW9OYhIF4GNOhOkh3xF/nAEJgIFisv58t5Y zFG3cmdvtbdGiqCeCtZyFTLeTixTQk5CRYpDKkKJYFW3LTNLMIyt2RT3SOZciik= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=sasl; b=Un9jeQ ByMzF1qEEVmwCSLc1ZRZQs5xZKwrK2cSBOAjWxX6T/98wWwy1YcJfjcouymSWZs8 +r9QernqSc4Bf0jLotj37tZPncgZOPIVHOAKYkV0xz7flnFC/BDsDoVwgGHnhrp/ qw/SZlhMSLjalPNAEm3t/fI2ymDsZe3hIvblA= Original-Received: from a-pb-sasl-quonix. (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 3FA44AE7C1; Tue, 27 Apr 2010 16:32:21 -0400 (EDT) Original-Received: from unquote (unknown [81.39.168.85]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTPSA id 2DFB4AE7C0; Tue, 27 Apr 2010 16:32:17 -0400 (EDT) In-Reply-To: <4BB53617.7060700@hulin.org.uk> (Ian Hulin's message of "Fri, 02 Apr 2010 01:11:03 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux) X-Pobox-Relay-ID: FB0441E6-523B-11DF-BB13-D033EE7EF46B-02397024!a-pb-sasl-quonix.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:10304 gmane.comp.gnu.lilypond.devel:28642 Archived-At: Hi Ian, On Fri 02 Apr 2010 02:11, Ian Hulin writes: > On 30/03/10 22:52, Ludovic =EF=BF=BD wrote: >> >> Lilypond does: >> >> --8<---------------cut here---------------start------------->8--- >> mod =3D scm_call_0 (maker); >> scm_module_define (mod, ly_symbol2scm ("%module-public-interface"= ), >> mod); >> --8<---------------cut here---------------end--------------->8--- >> >> Solution: do something like: >> >> --8<---------------cut here---------------start------------->8--- >> #ifdef HAVE_SCM_SET_MODULE_PUBLIC_INTERFACE_X >> scm_set_module_public_interface_x (mod, mod); >> #else >> scm_module_define (mod, ly_symbol2scm ("%module-public-interface"), >> mod); >> #endif >> --8<---------------cut here---------------end--------------->8--- >> >> (We just need to add that function.) As it appears here that you are trying to export everything from that module (in a somewhat incorrect formulation -- I can explain if you like), and that seems to be a sort of pattern, I'd suggest that instead we offer a module-export-all! function. Here is some code to provide such a function for pre-2.0 guile: (cond-expand ((not guile-2) (define (module-export-all! mod) (define (fresh-interface!) (let ((iface (make-module))) (set-module-name! iface (module-name mod)) ;; for guile 2: (set-module-version! iface (module-version mod= )) (set-module-kind! iface 'interface) (set-module-public-interface! mod iface) iface)) (let ((iface (or (module-public-interface mod) (fresh-interface!)))) (set-module-obarray! iface (module-obarray mod)))))) Use that to export all bindings instead. As it is, there are some shims for %module-public-interface hackery to keep on working if deprecated code is compiled in, but you should migrate to calling module-export-all!, I think. Then your C code would unconditionally: scm_call_1 (scm_variable_ref (module_export_all_var), mod); Regards, Andy --=20 http://wingolog.org/