From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.devel Subject: Re: Help required with exporting and using GOOP generics Date: Fri, 15 Mar 2013 17:05:06 -0400 Message-ID: <87obekz859.fsf@tines.lan> References: <20130315001141.XJRY9.69640.root@cdptpa-web09-z01> <51438B38.6040200@4dst.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1363381553 22832 80.91.229.3 (15 Mar 2013 21:05:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 15 Mar 2013 21:05:53 +0000 (UTC) Cc: guile-devel@gnu.org To: Brent Pinkney Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Mar 15 22:06:19 2013 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UGbpR-0005Yv-Ho for guile-devel@m.gmane.org; Fri, 15 Mar 2013 22:06:17 +0100 Original-Received: from localhost ([::1]:45633 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UGbp4-0001a6-R4 for guile-devel@m.gmane.org; Fri, 15 Mar 2013 17:05:54 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:45987) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UGbot-0001W0-Px for guile-devel@gnu.org; Fri, 15 Mar 2013 17:05:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UGbom-0007oE-AQ for guile-devel@gnu.org; Fri, 15 Mar 2013 17:05:43 -0400 Original-Received: from world.peace.net ([96.39.62.75]:35965) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UGbol-0007nu-Pz for guile-devel@gnu.org; Fri, 15 Mar 2013 17:05:36 -0400 Original-Received: from turntable.mit.edu ([18.160.0.29] helo=tines.lan) by world.peace.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1UGbof-00017C-1c; Fri, 15 Mar 2013 17:05:29 -0400 In-Reply-To: <51438B38.6040200@4dst.com> (Brent Pinkney's message of "Fri, 15 Mar 2013 22:57:28 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 96.39.62.75 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:15915 Archived-At: Mark H Weaver wrote: > The proper solution is as follows: > > * Every generic function must be defined (using 'define-generic') and > exported from one (and only one) module. > > * Every module that uses a generic function, or adds a method to it (and > that includes slot accessors), must first import the generic function > from the (one) module that exports it. > > Think of a generic function as a normal procedure that contains an > internal table of methods. Like any other procedure, there's a single > module that defines it and exports it. The fact that some modules add > methods to these internal tables does not mean that it is appropriate to > export the procedure from those other modules. Brent Pinkney wrote: > How does that work in an environment where you are using third party > libraries, lice srfi, ice-9, guile-lib, etc as well as your own code. I'm sorry, I don't understand what you mean here. > How could one possibly ensure that the other libraries export say > "format" correctly - perhaps they are purists and not even aware of > the goops modules. 'format' is not a generic function. What does that have to do with this discussion? > I think guile has it backwards here - goops must not break quiles > modules when someone imports a guile generic. Again, I don't understand. What do you mean by "break guile's modules"? Can you please elaborate? Thanks, Mark