From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Mikael Djurfeldt" Newsgroups: gmane.lisp.guile.user Subject: Re: [goops] adding a number class with generic methods Date: Tue, 9 May 2006 10:30:10 +0200 Message-ID: <66e540fe0605090130r70be830bo40a21ae71b043b5b@mail.gmail.com> References: <66e540fe0605041226q2a570820xc4eb08fc68051eb5@mail.gmail.com> <87fyjmrbv6.fsf@ossau.uklinux.net> <66e540fe0605070237r12b1ee34i22dfb7b63a2b1dd8@mail.gmail.com> <87ody73a37.fsf@laas.fr> Reply-To: djurfeldt@nada.kth.se NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1147163459 20607 80.91.229.2 (9 May 2006 08:30:59 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 9 May 2006 08:30:59 +0000 (UTC) Cc: Mikael Djurfeldt , Neil Jerram Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue May 09 10:30:54 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 1FdNbo-0005vV-RW for guile-user@m.gmane.org; Tue, 09 May 2006 10:30:21 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FdNbo-00071Z-AF for guile-user@m.gmane.org; Tue, 09 May 2006 04:30:20 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FdNbi-0006yM-Kw for guile-user@gnu.org; Tue, 09 May 2006 04:30:14 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FdNbg-0006vc-IF for guile-user@gnu.org; Tue, 09 May 2006 04:30:13 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FdNbg-0006vZ-E6 for guile-user@gnu.org; Tue, 09 May 2006 04:30:12 -0400 Original-Received: from [64.233.166.176] (helo=py-out-1112.google.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FdNch-0003dq-Nn for guile-user@gnu.org; Tue, 09 May 2006 04:31:15 -0400 Original-Received: by py-out-1112.google.com with SMTP id d80so1577277pyd for ; Tue, 09 May 2006 01:30:11 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=JByLGTZrufspuzX4GGXnc/8N3+o0HhhEbWnt0i/NBMA3PJ9nJepfYRGjvNuJQo/0gqAIRYdIRcFevGHKTJ4ZAD5G2TZ3FKPX9StPfR3XIoKuPd6jU+NVBtnVMhIwPjrNek3jsAfN+NOTynwiZMGJ+3qa8CnwHExyqGAwK84lF3c= Original-Received: by 10.35.66.12 with SMTP id t12mr2648685pyk; Tue, 09 May 2006 01:30:10 -0700 (PDT) Original-Received: by 10.35.69.9 with HTTP; Tue, 9 May 2006 01:30:09 -0700 (PDT) Original-To: "=?ISO-8859-1?Q?Ludovic_Court=E8s?=" , guile-user In-Reply-To: <87ody73a37.fsf@laas.fr> Content-Disposition: inline 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:5297 Archived-At: On 5/9/06, Ludovic Court=E8s wrote: > "Mikael Djurfeldt" writes: > > > In the current module system, the effect of mentioning a variable in > > an export statement is to set up a new, undefined, variable with that > > name. > > And thus the first `define-method' creates a new, empty, generic > function. That makes it sometimes quite tricky to spread method > definitions all over the place (e.g., see G-Wrap...). Could you elaborate on that? In what way does GOOPS/module system make this tricky, and how do you envision a better design? It is my opinion that the current design with regards to generic functions, methods and module system is in no way too restrictive. If you think it is, you should read the following reference: http://www2.parc.com/csl/groups/sda/publications/papers/Kiczales-OOPSLA92= /for-web.pdf Rather, I think the points where it can be criticized is that some things are a bit "too automatic" and there should be better and more error messages in some cases. If you want a certain generic function to be available everywhere, then you have to pose exactly the same question as you would do for an ordinary function: Which module should export this function?=20 Everybody else needs to import from that module, even those who add new methods. Of course, one may feel that the fact that methods can "spread" through the generic function in a rather arbitrary manner across module borders is a problem. For those who want a more restricted access to methods, there is the possibility to use extended generics.=20 This is explained in NEWS, I think. Best regards, M _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://lists.gnu.org/mailman/listinfo/guile-user