From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: David Pirotte Newsgroups: gmane.lisp.guile.user Subject: Re: Problem merging generics across modules Date: Fri, 13 Oct 2017 11:35:09 -0300 Message-ID: <20171013113509.09cf6049@capac> References: <8760bjncez.fsf@ateguix.i-did-not-set--mail-host-address--so-tickle-me> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/zATI/ztlyZ04PmwMdDxQ4PP"; protocol="application/pgp-signature" X-Trace: blaine.gmane.org 1507905533 2262 195.159.176.226 (13 Oct 2017 14:38:53 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 13 Oct 2017 14:38:53 +0000 (UTC) Cc: guile-user@gnu.org To: Andrew Erlanger Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Fri Oct 13 16:38:49 2017 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e316j-0007Bm-E9 for guile-user@m.gmane.org; Fri, 13 Oct 2017 16:38:37 +0200 Original-Received: from localhost ([::1]:50613 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e316q-0002yp-U3 for guile-user@m.gmane.org; Fri, 13 Oct 2017 10:38:44 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43237) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e313j-0001E7-47 for guile-user@gnu.org; Fri, 13 Oct 2017 10:35:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e313f-0007L8-V8 for guile-user@gnu.org; Fri, 13 Oct 2017 10:35:31 -0400 Original-Received: from maximusconfessor.all2all.org ([79.99.200.102]:35373) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e313f-0007Jr-Pg for guile-user@gnu.org; Fri, 13 Oct 2017 10:35:27 -0400 Original-Received: from localhost (unknown [192.168.0.2]) by maximusconfessor.all2all.org (Postfix) with ESMTP id 53869A04C1C8; Fri, 13 Oct 2017 16:35:25 +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 vXRdP8Az8sj6; Fri, 13 Oct 2017 16:35:21 +0200 (CEST) Original-Received: from capac (unknown [179.210.16.248]) by maximusconfessor.all2all.org (Postfix) with ESMTPSA id 67913A04C1DE; Fri, 13 Oct 2017 16:35:16 +0200 (CEST) In-Reply-To: <8760bjncez.fsf@ateguix.i-did-not-set--mail-host-address--so-tickle-me> X-Mailer: Claws Mail 3.15.1-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x [fuzzy] X-Received-From: 79.99.200.102 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:14209 Archived-At: --Sig_/zATI/ztlyZ04PmwMdDxQ4PP Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi again, > (define-module (project a) > #:use-module (oop goops) =20 > #:use-module (ice-9 r5rs) > #:duplicates (merge-generics) > #:export (equal?) > but this doesn't seem to do anything. Because that was not the source of your problem, see my previous email. Although in theory merge-generics is only needed when you import more then = one module that define the 'same' generic function, I personally recommend you to add = the option in any modules that use goops, unless you really know what you are doing: this is because as time goes, you may rearrange your modules, import others ... and forget that more then one defined a generic function, and .= .. bang! (and these bugs are among the most diffcult to track down and debug Note that you probably want more then just 'merge-generics, and prefer to e= xtend the default set: scheme@(guile-user)> (default-duplicate-binding-handler) $10 =3D (replace warn-override-core warn last) So this gives you: #:duplicates (merge-generics replace warn-override-core warn last) Also note that you have to set this in the repl as well, if you import more= then one module defining the 'same' generics ...: (default-duplicate-binding-handler '(merge-generics replace warn-override-core warn last)) $11 =3D (#< merge-generics (3)> # =E2=80=A6) scheme@(guile-user)> (default-duplicate-binding-handler) $12 =3D (merge-generics replace warn-override-core warn last) David --Sig_/zATI/ztlyZ04PmwMdDxQ4PP Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEhCJlRZtBM3furJHe83T9k6MFetcFAlngzx0ACgkQ83T9k6MF etdRLQgArI944X4AJjoxY69iK1vrAS+j7ISqKmNsZv2wRT6W9I9Bvw0A8TEkyBRk wKDQy5+RSB/BD/E7LHJ/tUeMYHLF11a0wLR3bDnp3QTNWJMa3Je2dhYhExaacX/k SKXom6NDRSm1yAv/mr1IsXqsQq76xTP05P6PQVC/q8iePnfJbbhh5dcFkS6EaROw EDU5MPdnorzbpDj482mlkuUF1jyqT4l8oe6PlAuVeSUQz3YH6LBWtiq45SaDfNvt sYvVrv2UxPVbbY06XFi+aryZzpN7GpmncUiZKqOvb8ROLadVzghkGkQ6SmpGK3B2 9xRGBbjspPfO73MmWL8KZwbunSzjZw== =Cdbp -----END PGP SIGNATURE----- --Sig_/zATI/ztlyZ04PmwMdDxQ4PP--