From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Pirotte Newsgroups: gmane.lisp.guile.bugs Subject: bug#19459: #:export does not honor the merge-generics contract Date: Thu, 23 Jun 2016 18:11:03 -0300 Message-ID: <20160623181103.00e09d95@capac> References: <20141228162024.048ca208@capac> <87vb11q8ir.fsf@pobox.com> <20160623162321.448e47af@capac> <87oa6rllfg.fsf@pobox.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_/mBZ/zBXiYnxtDrfmYCpM/ut"; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1466716355 11292 80.91.229.3 (23 Jun 2016 21:12:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 23 Jun 2016 21:12:35 +0000 (UTC) Cc: 19459@debbugs.gnu.org To: Andy Wingo Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Thu Jun 23 23:12:21 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 1bGBv4-0003KE-FH for guile-bugs@m.gmane.org; Thu, 23 Jun 2016 23:12:14 +0200 Original-Received: from localhost ([::1]:39493 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGBv3-0001Xk-Bt for guile-bugs@m.gmane.org; Thu, 23 Jun 2016 17:12:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40292) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGBuw-0001Xf-Tg for bug-guile@gnu.org; Thu, 23 Jun 2016 17:12:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bGBus-0001Pq-EJ for bug-guile@gnu.org; Thu, 23 Jun 2016 17:12:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:40729) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGBus-0001Pm-AW for bug-guile@gnu.org; Thu, 23 Jun 2016 17:12:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bGBus-0006y1-5y for bug-guile@gnu.org; Thu, 23 Jun 2016 17:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: David Pirotte Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Thu, 23 Jun 2016 21:12: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.146671627826716 (code B ref 19459); Thu, 23 Jun 2016 21:12:02 +0000 Original-Received: (at 19459) by debbugs.gnu.org; 23 Jun 2016 21:11:18 +0000 Original-Received: from localhost ([127.0.0.1]:53066 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bGBuA-0006wq-9A for submit@debbugs.gnu.org; Thu, 23 Jun 2016 17:11:18 -0400 Original-Received: from maximusconfessor.all2all.org ([79.99.200.102]:55892) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bGBu8-0006wh-BK for 19459@debbugs.gnu.org; Thu, 23 Jun 2016 17:11:16 -0400 Original-Received: from localhost (unknown [192.168.0.2]) by maximusconfessor.all2all.org (Postfix) with ESMTP id 281A3A04C142; Thu, 23 Jun 2016 23:11:15 +0200 (CEST) Original-Received: from maximusconfessor.all2all.org ([192.168.0.1]) by localhost (maximusconfessor.all2all.org [192.168.0.2]) (amavisd-new, port 10024) with ESMTP id 2n3Ah-HXBKGU; Thu, 23 Jun 2016 23:11:10 +0200 (CEST) Original-Received: from capac (unknown [179.210.35.216]) by maximusconfessor.all2all.org (Postfix) with ESMTPSA id 88D8EA04C138; Thu, 23 Jun 2016 23:11:09 +0200 (CEST) In-Reply-To: <87oa6rllfg.fsf@pobox.com> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) 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:8190 Archived-At: --Sig_/mBZ/zBXiYnxtDrfmYCpM/ut Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable > > Hi Andy, > > =20 > >> > (define-module (a) > >> > #:use-module (oop goops) > >> > #:export ( > >> > !width > >> > get-width > >> > set-width)) =20 > > =20 > >> Here you export four bindings: one class and three generics. Those > >> three generics have methods on . =20 > > =20 > >> > (define-module (b) > >> > #:use-module (oop goops) > >> > #:use-module (a) =20 > > =20 > >> Here you import the previous four bindings. =20 > > =20 > >> > #:export ( > >> > !width > >> > get-width > >> > set-width)) =20 > > =20 > >> However here you declare that you are going to export four new > >> bindings. > >> ... =20 > > > > Under the exact circumstances of the original email, I disagree, see be= low. =20 >=20 > I see. You were expecting for the dynamically setting the > default-duplicate-binding-handler parameter to make a difference. Yes, and it has to: with that setting, at any time in any module, there can= be 1 and only 1 generic function for a given name: but as it is, right now, even with that setting, Guile is exporting 'something' I did not ask to export, Guile is exporting a new binding, that I never asked to create [unless it would not be imported] from the (b) module perspective, I ask Guile to import (a), fill the gener= ic functions with new methods, and export it, these generic functions, not new other ones The symptom of the actual anomaly is very well expressed by my last sentenc= e: "... last but not least, when a user imports (b) and run (make ), he is not himself calling set-width or get-width: exported or not, the code being run by make should run within the (b) module, and in the (b) module they c= an be only 1 generic function, with the method of (a) and the method of (b)..= ." This should never raise an exception: scheme@(guile-user)> ,use (b) scheme@(guile-user)> (make ) Currently it does if the user used #:export, it does not if he/she does not= export The problem is guile's module system, not GOOPS here > However I think this is maybe not the right way to set this up; see > reasoning in http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D20093. That is/was a totally different bug, but thanks for the fix! I disagree wi= th the comment though, but I will pull, compile test it will take 1 or 2 days... I hope it fixes it! > 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 probl= em is that once the user uses #:export, guile's module system create a new bindin= g, and it should not ... [hence this confusion as well: as it is: the module must mer= ge its definition with the imported ones, even if it imported only 1 generic ... b= ecause of a module bug...] David --Sig_/mBZ/zBXiYnxtDrfmYCpM/ut Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJXbFBnAAoJEPN0/ZOjBXrXV84IAKgyLdvldWCj5KeP/Lhr06OH 1S5IfTrIzCvuOFe69KYx/qTcbm3WizdEP2pseg1TRwm2HMT6lyUt5AZwtMTR+HBN tZKprozadL0+yniU0BExK6Z5jvVjPb47q2RGxwzP7SoEzi5v1A36fJO52LEkI2P6 +nwEMypQSFBzhK7NjdGNRBf8+wGS+kIw2of+6lKEzf+WKnLjexLiTyz5np8h7NTm LHLjOdx4k5t+58LcKSOP07L97ziC3iT0RMfjvS4/eOiQ33yed6PjrbDCNn5iSTvG 6ej7OFMjz04chu+Ni9ZrchsqCinno5n6HqhqXO+x3CVW8r/x9zql9iBcvs0LceU= =TNUS -----END PGP SIGNATURE----- --Sig_/mBZ/zBXiYnxtDrfmYCpM/ut--