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: Sun, 28 Dec 2014 16:20:24 -0200 Message-ID: <20141228162024.048ca208@capac> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/vOYtH6x_Yv+tT9Ug8btPg2Y"; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1419790938 20750 80.91.229.3 (28 Dec 2014 18:22:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 28 Dec 2014 18:22:18 +0000 (UTC) To: 19459@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sun Dec 28 19:22:12 2014 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 1Y5ITi-0008EX-WC for guile-bugs@m.gmane.org; Sun, 28 Dec 2014 19:22:11 +0100 Original-Received: from localhost ([::1]:59188 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y5ITi-0002VW-1A for guile-bugs@m.gmane.org; Sun, 28 Dec 2014 13:22:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47131) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y5ITd-0002VO-IN for bug-guile@gnu.org; Sun, 28 Dec 2014 13:22:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y5ITa-0000be-8Y for bug-guile@gnu.org; Sun, 28 Dec 2014 13:22:05 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:50571) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y5ITa-0000ba-5B for bug-guile@gnu.org; Sun, 28 Dec 2014 13:22:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Y5ITZ-0004vU-NO for bug-guile@gnu.org; Sun, 28 Dec 2014 13:22:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: David Pirotte Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sun, 28 Dec 2014 18:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 19459 X-GNU-PR-Package: guile X-GNU-PR-Keywords: X-Debbugs-Original-To: Original-Received: via spool by submit@debbugs.gnu.org id=B.141979086518854 (code B ref -1); Sun, 28 Dec 2014 18:22:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 28 Dec 2014 18:21:05 +0000 Original-Received: from localhost ([127.0.0.1]:59937 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y5ISe-0004u2-Af for submit@debbugs.gnu.org; Sun, 28 Dec 2014 13:21:04 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:45314) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y5ISc-0004tu-RB for submit@debbugs.gnu.org; Sun, 28 Dec 2014 13:21:03 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y5ISb-0000VZ-Dx for submit@debbugs.gnu.org; Sun, 28 Dec 2014 13:21:02 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:46497) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y5ISb-0000VT-BD for submit@debbugs.gnu.org; Sun, 28 Dec 2014 13:21:01 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47036) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y5ISa-0002SL-0m for bug-guile@gnu.org; Sun, 28 Dec 2014 13:21:01 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y5ISW-0000Uy-O1 for bug-guile@gnu.org; Sun, 28 Dec 2014 13:20:59 -0500 Original-Received: from maximusconfessor.all2all.org ([79.99.200.102]:51465) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y5ISW-0000SD-FJ for bug-guile@gnu.org; Sun, 28 Dec 2014 13:20:56 -0500 Original-Received: from localhost (unknown [192.168.0.2]) by maximusconfessor.all2all.org (Postfix) with ESMTP id 6160FA04C250 for ; Sun, 28 Dec 2014 19:20:34 +0100 (CET) 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 r7npxFw+X0U0 for ; Sun, 28 Dec 2014 18:57:02 +0100 (CET) Original-Received: from capac (unknown [179.210.40.164]) by maximusconfessor.all2all.org (Postfix) with ESMTPSA id E33B9A04C258 for ; Sun, 28 Dec 2014 19:20:26 +0100 (CET) X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:7695 Archived-At: --Sig_/vOYtH6x_Yv+tT9Ug8btPg2Y Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello, debian testing GNU Guile 2.0.11 [ mine is .10-fa1a3-dirty, but it does not matter [ i'm stuck in that version until goops is patched [ and compiles guile-gnome again... #:export does not honor the merge-generics contract #:export should be adapted to honor the 'merge-generics user request and 'c= ontract'. What ever forces the 'system' to create a generic function, #:export in thi= s case, when 'merge-generics has been set, the system should or use the imported ge= neric and add the newly locally defined method, or create a new one [if that is neces= sary for its internal machinery] _but_ [immediately] merge it with th imported one, sinc= e it is the user request. Right now, even with the merge-generic setting, #:export calls module-ensure-local-variable! before anything else, creates a new get-with var, first unbound, later turned into a generic function with 1 applicable [locally defined] method only _but_ it does _not_not merge it, l= eading to "No applicable method..." bugs, as in the following example [simple and stupid,= but it only partially mimics real case situation, see the image.scm attachment of = this mail if you're interested http://www.mail-archive.com/guile-devel@gnu.org/msg126= 18.html Happy hacking, David ;; module a starts here (define-module (a) #:use-module (oop goops) #:export ( !width get-width set-width)) (define-class () (width #:accessor !width #:init-keyword #:width #:init-value 0)) (define-method (get-width (self )) (!width self)) (define-method (set-width (self ) width) (set! (!width self) width)) ;; module a ends here ;; module b starts here (define-module (b) #:use-module (oop goops) #:use-module (a) #:export ( !width get-width set-width)) (define-class () (width #:accessor !width #:init-keyword #:width #:init-value 0)) (define-method (initialize (self ) initargs) (next-method) =20 (let ((a (make ))) (set-width self (get-width a)) #;(add-child b a))) (define-method (get-width (self )) (!width self)) (define-method (set-width (self ) width) (set! (!width self) width)) ;; module b ends here scheme@(guile-user)> ,use (oop goops) scheme@(guile-user)> (default-duplicate-binding-handler '(merge-generics re= place warn-override-core warn last)) scheme@(guile-user)> ,use (b) ;;; note: source file ./b.scm ;;; newer than compiled /home/david/.cache/guile/ccache/2.0-LE-8-2.0/= usr/alto/projects/guile-tests/goops/export/b.scm.go ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=3D0 ;;; or pass the --no-auto-compile argument to disable. ;;; compiling ./b.scm ;;; compiled /home/david/.cache/guile/ccache/2.0-LE-8-2.0/usr/alto/projects= /guile-tests/goops/export/b.scm.go scheme@(guile-user)> (make ) ERROR: In procedure scm-error: ERROR: No applicable method for #< get-width (1)> in call (get-wid= th #< 2b70880>) Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue. scheme@(guile-user) [1]> ,bt In oop/goops.scm: 1553:4 3 (# #< 28cb8=E2=80=A6>) In guile-tests/goops/export/b.scm: 17:20 2 (# #<<=E2=80=A6> =E2=80=A6) In oop/goops/dispatch.scm: 239:9 1 (cache-miss #< get-width (1)> (#< 2b70880>)) In unknown file: 0 (scm-error goops-error #f "No applicable method for ~S in call= ~S" (#< =E2=80=A6> =E2=80=A6) =E2=80=A6) scheme@(guile-user) [1]>=20 --Sig_/vOYtH6x_Yv+tT9Ug8btPg2Y Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJUoEnoAAoJEPN0/ZOjBXrXoz8IAKPYsO45ScJDsl5IB+Aqeiwc 0LgKWEpDvFh9LKfkv3iqKmCU3W0OlbWByBYtRdhC/qrr4Y+7GebCV3ytLQUwjHo6 JqE3dMXvtDhVoFdj6tF3r0U4/zGdP3hpxjf+WhegURcqHtDgMAxpFqRp8CSHrGGc 4h5uNVDLq7BeEg9Vw6Lhr3kSmb3cFBp5SFrOXSQjke9EhguJ6ev86bHb1JzywNGv TQxeQTm8shtZSyH47vHbcchzLfth/r1ncXZUc+Feisw4qyR2mwSSrmFWZynZ1Exz oPR2CJ4z1i7vUdmtlYK2vPbFn7RyUmvuzLCyxkfhHgZfUb5aicOtLA7rlVwaCA0= =oppc -----END PGP SIGNATURE----- --Sig_/vOYtH6x_Yv+tT9Ug8btPg2Y--