From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.bugs Subject: bug#19459: #:export does not honor the merge-generics contract Date: Mon, 27 Jun 2016 09:47:01 +0200 Message-ID: <87d1n39iq2.fsf@pobox.com> References: <20141228162024.048ca208@capac> <87vb11q8ir.fsf@pobox.com> <20160623162321.448e47af@capac> <87oa6rllfg.fsf@pobox.com> <20160623181103.00e09d95@capac> <87twgjji1k.fsf@pobox.com> <20160626235455.7726d721@capac> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1467013707 12104 80.91.229.3 (27 Jun 2016 07:48:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 27 Jun 2016 07:48:27 +0000 (UTC) Cc: 19459@debbugs.gnu.org To: David Pirotte Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Mon Jun 27 09:48:17 2016 Return-path: Envelope-to: guile-bugs@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 1bHRHC-0003sK-Sj for guile-bugs@m.gmane.org; Mon, 27 Jun 2016 09:48:15 +0200 Original-Received: from localhost ([::1]:57023 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHRHC-0006kn-0f for guile-bugs@m.gmane.org; Mon, 27 Jun 2016 03:48:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36363) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHRH5-0006kg-Pu for bug-guile@gnu.org; Mon, 27 Jun 2016 03:48:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bHRH0-0007y7-J2 for bug-guile@gnu.org; Mon, 27 Jun 2016 03:48:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:45083) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHRH0-0007y2-Ee for bug-guile@gnu.org; Mon, 27 Jun 2016 03:48:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bHRH0-0007ue-6y for bug-guile@gnu.org; Mon, 27 Jun 2016 03:48:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andy Wingo Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Mon, 27 Jun 2016 07:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19459 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 19459-submit@debbugs.gnu.org id=B19459.146701363430353 (code B ref 19459); Mon, 27 Jun 2016 07:48:02 +0000 Original-Received: (at 19459) by debbugs.gnu.org; 27 Jun 2016 07:47:14 +0000 Original-Received: from localhost ([127.0.0.1]:57420 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bHRGE-0007tV-Bq for submit@debbugs.gnu.org; Mon, 27 Jun 2016 03:47:14 -0400 Original-Received: from pb-sasl1.pobox.com ([64.147.108.66]:64867 helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bHRGD-0007tO-3C for 19459@debbugs.gnu.org; Mon, 27 Jun 2016 03:47:13 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id C402B20300; Mon, 27 Jun 2016 03:47:09 -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; s=sasl; bh=urwU8f3VLHI3m+KDePtBq9Fi/Uk=; b=F8buwM LY+Ga4XKyqyaCNcHHk4YCxW6qyqVPlJMstFGKlWZNSkuZ5gXcV/u6SVYvdacat6W lajn7K21iZnZ/bGlj44Nb1tDLrUXDxrnHyG+mn7b3tPARF2hequ1Y5y4LCxS87tK OQviWwK8ywAuVhltxh8bPRHRBLChMLunH9Vzo= 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; q=dns; s=sasl; b=eR2cABn+lMDw0lGyVmpbuBAqKQMV2VN2 +Bgq7GoO8HxPUSc43WLK5HGS8ChJbYgiwr4cQhCMoARX7UdosysFkqffNLoQgZAY nSSVk+MhyDq0wvKgCxIt35vycoqlxGx7vgEgn7CyqTeC58OzY0R9dPiHVBE/sypx AdXF+3Eoy44= Original-Received: from pb-sasl1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id BC73C202FE; Mon, 27 Jun 2016 03:47:09 -0400 (EDT) Original-Received: from clucks (unknown [88.160.190.192]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pb-sasl1.pobox.com (Postfix) with ESMTPSA id D4C6D202FC; Mon, 27 Jun 2016 03:47:08 -0400 (EDT) In-Reply-To: <20160626235455.7726d721@capac> (David Pirotte's message of "Sun, 26 Jun 2016 23:54:55 -0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) X-Pobox-Relay-ID: 59F5A60A-3C3B-11E6-B682-C1836462E9F6-02397024!pb-sasl1.pobox.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.org gmane.lisp.guile.bugs:8260 Archived-At: On Mon 27 Jun 2016 04:54, David Pirotte writes: > Hello Andy, > >> >> However... I believe merge-generics is intended to merge duplicate >> >> imported bindings. It does not provide a copy-on-write version of an >> >> imported generic, if that generic was not duplicated in the imports. >> >> There is no facility in GOOPS to do that, AFAIU. > >> > It is a module bug, not a GOOPS bug, see my 'personal/local' fix: the problem is >> > that once the user uses #:export, guile's module system create a new binding, >> > and it should not ... [hence this confusion as well: as it is: the module must >> > merge its definition with the imported ones, even if it imported only 1 >> > generic ... because of a module bug...] > >> I... I just think you're wrong here, sorry :/ That's just not how the >> system works. If you #:export an identifier in a module, you create a >> fresh local binding, and that binding doesn't implicitly extend an >> imported binding, merge-generics or no. Merge-generics only operates on >> the import interface of a module. > > I don't think so, and I feel sorry too ;/. We disagree, which is different, and > nobody is 'right' or 'wrong' here. [and I know 'how the system works, I described > it that in the original email, I'd like to change that, hence this thread ...] > > IMO, this should never fail: > > ,use (b) > make There are plenty of reasons for (make foo) to fail in the abstract -- from bad logic in the initializers, to the initializer using unbound variables, to many other things. In this case your initializer is: (define-method (initialize (self ) initargs) (next-method) (let ((a (make ))) (set-width self (get-width a)) #;(add-child b a))) However in this module you have done an #:export get-width on B, and so the get-width that you are calling in module (b) has no methods for values of type A. > Your last sentence states that merge-generics only operates on the import interface > of a module: that is the feature I'm referring to to claim the above: > > [ using #:export ] > > t0 the system creates new 'empty' binding > at some point 'it' knows it is a gf > ti it imports (a) > > now the (b) module interface is facing a duplicate gf binding, and according > to the user settings wrt to this, it has to merge. I'm not sure from this whether you think the current code has a bug or a feature limitation. For me :) I have it clear in my mind that there does not appear to be a bug here. merge-generics only operates over bindings that are imported in a module: module A imports modules B and C, and B and C both export a generic `foo'. Or one is a generic and one is not, or something like that. merge-generics *does not* merge an imported binding and a local definition. It does seem like you want the system to work in a different way, and that position is understandable -- however designing and implementing such a thing is very low on my priority list right now and I doubt I will get to it any time soon if at all. If you or someone else wants to implement this, the first step would be to come up with a design including a patch to the documentation and mail the list. I think I would want the design before seeing a patch. Regards, Andy