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#20093: Fw: bug#20093: master: setting merge-generics duplicate-binding-handler @ expand time raises an error Date: Sun, 3 Jul 2016 17:55:06 -0300 Message-ID: <20160703175506.17cbe958@capac> References: <20150312001718.5d1ae438@capac> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_/RzmC+txsCYBAmrr.g3+jFKQ"; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1467579385 2776 80.91.229.3 (3 Jul 2016 20:56:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 3 Jul 2016 20:56:25 +0000 (UTC) To: 20093@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sun Jul 03 22:56:15 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 1bJoR4-0005UR-To for guile-bugs@m.gmane.org; Sun, 03 Jul 2016 22:56:15 +0200 Original-Received: from localhost ([::1]:44090 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bJoR4-0002Dm-A4 for guile-bugs@m.gmane.org; Sun, 03 Jul 2016 16:56:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54118) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bJoQw-0002DC-TJ for bug-guile@gnu.org; Sun, 03 Jul 2016 16:56:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bJoQs-00075d-Mg for bug-guile@gnu.org; Sun, 03 Jul 2016 16:56:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:52163) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bJoQs-00075Z-Ib for bug-guile@gnu.org; Sun, 03 Jul 2016 16:56:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bJoQs-00062X-AC for bug-guile@gnu.org; Sun, 03 Jul 2016 16:56:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <20150312001718.5d1ae438@capac> Resent-From: David Pirotte Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sun, 03 Jul 2016 20:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20093 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 20093-submit@debbugs.gnu.org id=B20093.146757932423176 (code B ref 20093); Sun, 03 Jul 2016 20:56:02 +0000 Original-Received: (at 20093) by debbugs.gnu.org; 3 Jul 2016 20:55:24 +0000 Original-Received: from localhost ([127.0.0.1]:36267 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bJoQG-00061k-3D for submit@debbugs.gnu.org; Sun, 03 Jul 2016 16:55:24 -0400 Original-Received: from maximusconfessor.all2all.org ([79.99.200.102]:36333) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bJoQE-00061b-C7 for 20093@debbugs.gnu.org; Sun, 03 Jul 2016 16:55:23 -0400 Original-Received: from localhost (unknown [192.168.0.2]) by maximusconfessor.all2all.org (Postfix) with ESMTP id 32B80A04C12C for <20093@debbugs.gnu.org>; Sun, 3 Jul 2016 22:55:21 +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 llCApfmhjN5n for <20093@debbugs.gnu.org>; Sun, 3 Jul 2016 22:55:16 +0200 (CEST) Original-Received: from capac (unknown [179.210.32.130]) by maximusconfessor.all2all.org (Postfix) with ESMTPSA id B48BCA04C0E1 for <20093@debbugs.gnu.org>; Sun, 3 Jul 2016 22:55:15 +0200 (CEST) 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:8271 Archived-At: --Sig_/RzmC+txsCYBAmrr.g3+jFKQ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Andy, It is only after I answered that I did spot in the close associated with this bug report that we should 'get further detail' answering the bug id a= nd not bug-id-done, hence this 'forward' > This was interesting -- turned out that GOOPS imports `map' from (srfi > srfi-1), and it's also there from (guile-user). SRFI-1 specified it via > #:replace so all is well, no warnings. However merge-generics is itself > a generic which needs `map' to dispatch over its types (at first) and > then that recurses, leading to badness. =20 Thanks, it fixed the bug wrt the example of the original message, but it se= ems it introduced a new bug, see below. > But, you say, I only specified the duplicates handler after loading > goops! Well indeed, but if a module didn't specify #:duplicates, its > duplicates handling was implicitly dynamically scoped to whatever the > current default-duplicates-handlers were. That seems bogus to me: the > module declares its imports and exports and a lack of a declaration of > #:duplicates indicates that the module is implicitly specifying the > duplicate handlers that are described in the manual. =20 > In master I have changed the `default-duplicate-binding-handler' to > simply access the handlers for the current module, as that seems to be > the correct thing. Let me know how it goes! Closing as done but let's > follow up :) =20 This is a big problem for me, so I partially locally reverted that part of the patch, plus, I patch guild so it does this before anything else: (eval-when (expand load eval) (use-modules (oop goops)) (default-duplicate-binding-handler '(merge-generics replace warn-override-core warn last))) This worked well with guile-2.0 [guild patched the same way I mean], but ra= ises a bug using guild from 2.2, that I can reproduce even not reverting anything = from your fix: if you patch guild the same way, just to try, then try to compile any file that does even not use goops, it raises the same error As an example, let's create a reexport.scm [based on guile-gnome glib/gnome/gw/support/modules.scm] ;; reexport.scm starts here (define-module (reexport) #:export (re-export-public-interface)) (define-macro (re-export-public-interface . args) "Re-export the public interface of a module or modules. Invoked as @code{(re-export-public-interface (mod1) (mod2)...)}." (if (null? args) '(if #f #f) `(begin ,@(map (lambda (mod) (or (list? mod) (error "Invalid module specification" mod)) `(module-use! (module-public-interface (current-module)) (resolve-interface ',mod))) args)))) ;; reexport.scm ends here Then let's try to compile it using the patched guild as mentioned above: david@capac:~/gnu/grip/git/grip 5 $ which guild /opt2/bin/guild david@capac:~/gnu/grip/git/grip 6 $ guild compile reexport.scm=20 ;;; note: source file /opt2/bin/guild ;;; newer than compiled /home/david/.cache/guile/ccache/2.2-LE-8-3.9/opt2/bin/guild.go ;;;= note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=3D0 ;;; or pass t= he --no-auto-compile argument to disable. ;;; compiling /opt2/bin/guild ;;; WARNING: compilation of /opt2/bin/guild failed: ;;; ERROR: No applicable method for #< merge-generics (3)> in call (merge-generics # format # # # # #f #f) Backtrace: In ice-9/eval.scm: 710:2= 0 19 (primitive-eval (define (main args) (if (# (# #)) #) #)) In ice-9/psyntax.s= cm: 1199:22 18 (expand-top-sequence ((define (main args) (if (=E2=80=A6) =E2=80= =A6) =E2=80=A6)) =E2=80=A6) In ice-9/boot-9.scm: 224:17 17 (map1 (#)) In ice-9/psyntax.scm: 1374:12 16 (_) 1754:11 15 (lp (#(syntax-object (if (defined? (quote #)) #) # =E2=80=A6) = =E2=80=A6) =E2=80=A6) 1644:45 14 (parse _ _ _ _ _ _ _) In ice-9/boot-9.scm: 224:17 13 (map1 (((("placeholder" placeholder) ("=E2=80=A6" . #) =E2=80= =A6) . #) =E2=80=A6)) In ice-9/psyntax.scm: 1374:12 12 (_ _ _) 1449:23 11 (_ _ _) In ice-9/boot-9.scm: 224:29 10 (map1 ((quote system-error) (lambda () (setlocale =E2=80=A6)) = #)) 224:29 9 (map1 ((lambda () (setlocale LC_ALL "")) (lambda # #))) 224:17 8 (map1 ((lambda args (format (current-error-port) # #)))) In ice-9/psyntax.scm: 1754:11 7 (lp ((format (current-error-port) "warning: failed=E2=80=A6" = =E2=80=A6)) =E2=80=A6) 1577:33 6 (parse (((("placeholder" placeholder) ("=E2=80=A6" . #) =E2=80= =A6) . #)) =E2=80=A6) 1298:27 5 (syntax-type (format (current-error-port) "warning:=E2=80=A6" = =E2=80=A6) =E2=80=A6) 1282:39 4 (syntax-type format (("placeholder" placeholder) # # =E2=80=A6= ) =E2=80=A6) 302:24 3 (resolve-identifier _ _ (("placeholder" placeholder) =E2=80=A6= ) =E2=80=A6) In unknown file: 2 (module-variable # format) In oop/goops.scm: 1437:4 1 (cache-miss # format # =E2=80=A6) In unknown file: 0 (scm-error goops-error #f "No applicable method for ~S=E2=80= =A6" =E2=80=A6) ERROR: In procedure scm-error: ERROR: No applicable method for #< merge-generics (3)> in call (merge-generics # format # # # # #f #f) david@capac:~/gnu/grip/git/grip 7 $= =20 NOW, let's ask guild to use --no-auto-compile #!/bin/sh # -*- scheme -*- exec ${GUILE:-/opt2/bin/guile} --no-auto-compile -e '(@@ (guild) main)' -s = "$0" "$@" !# ... ... And try again: david@capac:~/gnu/grip/git/grip 8 $ guild compile reexport.scm=20 ;;; note: source file /opt2/bin/guild ;;; newer than compiled /home/david/.cache/guile/ccache/2.2-LE-8-3.9/opt2/bin/guild.go Bac= ktrace: In ice-9/eval.scm: 710:20 19 (primitive-eval (define (main args) (if (# (# #)) #) #)) In ice-9/psyntax.scm: 1199:22 18 (expand-top-sequence ((define (main args) (if (=E2=80=A6) =E2= =80=A6) =E2=80=A6)) =E2=80=A6) In ice-9/boot-9.scm: 224:17 17 (map1 (#)) In ice-9/psyntax.scm: 1374:12 16 (_) 1754:11 15 (lp (#(syntax-object (if (defined? (quote #)) #) # =E2=80=A6) = =E2=80=A6) =E2=80=A6) 1644:45 14 (parse _ _ _ _ _ _ _) In ice-9/boot-9.scm: 224:17 13 (map1 (((("placeholder" placeholder) ("=E2=80=A6" . #) =E2=80= =A6) . #) =E2=80=A6)) In ice-9/psyntax.scm: 1374:12 12 (_ _ _) 1449:23 11 (_ _ _) In ice-9/boot-9.scm: 224:29 10 (map1 ((quote system-error) (lambda () (setlocale =E2=80=A6)) = #)) 224:29 9 (map1 ((lambda () (setlocale LC_ALL "")) (lambda # #))) 224:17 8 (map1 ((lambda args (format (current-error-port) # #)))) In ice-9/psyntax.scm: 1754:11 7 (lp ((format (current-error-port) "warning: failed=E2=80=A6" = =E2=80=A6)) =E2=80=A6) 1577:33 6 (parse (((("placeholder" placeholder) ("=E2=80=A6" . #) =E2=80= =A6) . #)) =E2=80=A6) 1298:27 5 (syntax-type (format (current-error-port) "warning:=E2=80=A6" = =E2=80=A6) =E2=80=A6) 1282:39 4 (syntax-type format (("placeholder" placeholder) # # =E2=80=A6= ) =E2=80=A6) 302:24 3 (resolve-identifier _ _ (("placeholder" placeholder) =E2=80=A6= ) =E2=80=A6) In unknown file: 2 (module-variable # format) In oop/goops.scm: 1437:4 1 (cache-miss # format # =E2=80=A6) In unknown file: 0 (scm-error goops-error #f "No applicable method for ~S=E2=80= =A6" =E2=80=A6) ERROR: In procedure scm-error: ERROR: No applicable method for #< merge-generics (3)> in call (merge-generics # format # # # # #f #f) david@capac:~/gnu/grip/git/grip 9 $= =20 BUT THIS Works:fine, in case it gives you come idea [it raises a warning th= ough, is this warning expected?] david@capac:~/alto/projects/guile-tests/goops 3 $ guile GNU Guile 2.1.3.52-8a087 Copyright (C) 1995-2016 Free Software Foundation, Inc. Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. This program is free software, and you are welcome to redistribute it under certain conditions; type `,show c' for details. Enter `,help' for help. scheme@(guile-user)> ,use (oop goops) scheme@(guile-user)> (default-duplicate-binding-handler '(merge-generics replace warn-override-core warn last)) ;;; warning: unknown warning type `macro-use-before-definition' $1 =3D (#< merge-generics (3)> # # # #) scheme@(guile-user)> ,use (system base compile) scheme@(guile-user)> (compile-file "/home/david/gnu/grip/git/grip/reexport.= scm") ;;; warning: unknown warning type `macro-use-before-definition' $2 =3D "/home/david/.cache/guile/ccache/2.2-LE-8-3.9/usr/alto/projects/gnu/grip/gi= t/grip/reexport.scm.go" scheme@(guile-user)>=20 Sorry for the long email! I hope you can help! Cheers, David --Sig_/RzmC+txsCYBAmrr.g3+jFKQ Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJXeXusAAoJEPN0/ZOjBXrXtbsH/2haUdJK4eojjPph+C0AjKg+ fItwf8801q6MtFjZfRuWlPY4mjMKhQMweMDgsZjeBLiNdcfG9ybDw0BnvVBxkZKG /k6C7KdXHz1xElDDRo+6kpJEQ2DyRN6VHiDt6WqTW+Zrvc5DTYzFuNZjRPx33BJF cDrJlw/0Qvg6CEDE87fx6CoZc8vgLbpnzLJBtXqrBtWh6+Fm4YNIoWQrlD9VsMKw wgGhBIeKtrtSIpNHVK8DulRDxEn8PF3jxnNBlM5hyCCdcSb3GXF01Ns0pDXiausX JFwUZHwczc/Y1sTsY5/gq1SgTLfblz2zOObpISsxuoJpffu22ckTjh6P3xF3ufg= =9x6c -----END PGP SIGNATURE----- --Sig_/RzmC+txsCYBAmrr.g3+jFKQ--