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, 24 Jul 2016 23:38:48 -0300 Message-ID: <20160724233848.04c33f5e@capac> References: <20150312001718.5d1ae438@capac> <20160703175506.17cbe958@capac> <87oa69694l.fsf@pobox.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_/tDcdEEwqQ+h5kl76Sip3uaq"; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1469414432 10617 80.91.229.3 (25 Jul 2016 02:40:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 25 Jul 2016 02:40:32 +0000 (UTC) Cc: 20093@debbugs.gnu.org To: Andy Wingo Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Mon Jul 25 04:40:20 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 1bRVoX-0005ry-MM for guile-bugs@m.gmane.org; Mon, 25 Jul 2016 04:40:17 +0200 Original-Received: from localhost ([::1]:58320 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRVoW-0005jS-U3 for guile-bugs@m.gmane.org; Sun, 24 Jul 2016 22:40:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35748) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRVoN-0005f5-Je for bug-guile@gnu.org; Sun, 24 Jul 2016 22:40:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bRVoI-0004Xq-Ih for bug-guile@gnu.org; Sun, 24 Jul 2016 22:40:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:52088) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRVoI-0004Xl-FO for bug-guile@gnu.org; Sun, 24 Jul 2016 22:40:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bRVoI-0006UD-85 for bug-guile@gnu.org; Sun, 24 Jul 2016 22:40:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: David Pirotte Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Mon, 25 Jul 2016 02:40: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.146941434324858 (code B ref 20093); Mon, 25 Jul 2016 02:40:02 +0000 Original-Received: (at 20093) by debbugs.gnu.org; 25 Jul 2016 02:39:03 +0000 Original-Received: from localhost ([127.0.0.1]:36192 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bRVnL-0006Ss-7w for submit@debbugs.gnu.org; Sun, 24 Jul 2016 22:39:03 -0400 Original-Received: from maximusconfessor.all2all.org ([79.99.200.102]:55451) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bRVnJ-0006SQ-G9 for 20093@debbugs.gnu.org; Sun, 24 Jul 2016 22:39:02 -0400 Original-Received: from localhost (unknown [192.168.0.2]) by maximusconfessor.all2all.org (Postfix) with ESMTP id B90B5A04C0CC; Mon, 25 Jul 2016 04:38:59 +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 ApTJkXbWVV4m; Mon, 25 Jul 2016 04:38:55 +0200 (CEST) Original-Received: from capac (unknown [179.210.32.222]) by maximusconfessor.all2all.org (Postfix) with ESMTPSA id BD7D8A04C0E1; Mon, 25 Jul 2016 04:38:54 +0200 (CEST) In-Reply-To: <87oa69694l.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:8317 Archived-At: --Sig_/tDcdEEwqQ+h5kl76Sip3uaq Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi Andy, > > 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))) =20 > It takes work for me to understand and fix reports and I regret to say > that patching "guild" is too much for me -- I don't have the time to > work on bugs in patched Guile versions where the patches are significant > (like this patch) and yet not headed towards mainline (also like this > patch). Let's not get lost in 2 diff things here: 1-=20 As a consequence of you looking at this bug report, you decided to change t= he module system: > 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 I did think very carefully to this and our conversation, and I still think = it as a big mistake: if a module does not declare #:duplicates, the 'old' way is th= e right way, calling (default-duplicate-binding-handler). Yes, it would then be a user error not to properly globally set this at 'all incantations', compile, load ... if they rely on a diff set then the defaul: the fact that users may miss use it does not justify it's been taken away: they are quite a lot of ways a user can write bugs, as you know, so let's get rid of set! then :) IMO, this is an API, the right one, so it should not be changed. Note that users of 'these modules' (the ones where you'd locally declare #:duplicates) still have to set this in their repl and in their scripts, no= t doing so would also be an user error and this 'new' model does not prevent these = errors. I have successfully used it for years now: it saves me to have to do it at = module level, and since I correctly set it globally: forcing me (and other users o= f this API) sounds a bit of a brute forcing a certain programing style: since I kn= ow what I'm doing, I don't see local declarations being 'better', but just another = way to do it. As a mater of fact, I see the global setting better and safer, because = I'll never forget... Please think about this, thanks! 2- Now, a separate thing is I can't set this in guild anymore. Ok, I read you,= but guild is a script, and IMO, there is no reason I can do it in a script of mine an= d not in guild, this works fine: ;; compile-me script starts here #! /bin/sh # -*- mode: scheme; coding: utf-8 -*- exec guile --no-auto-compile -e main -s $0 "$@" !# (eval-when (expand load eval) (use-modules (oop goops)) (default-duplicate-binding-handler '(merge-generics replace warn-override-core warn last))) (use-modules (system base compile) (ice-9 match)) =20 (define (main args) =09 (pk (default-duplicate-binding-handler)) (add-to-load-path (getcwd)) (match args ((cmd file) (compile-file file) (display (string-append "I compiled you: " file "\n"))))) ;; compile-me script ends here [ drop this somewhere, chmod a+x=20 ;; foo.scm starts here (define-module (a) #:use-module (oop goops) #:export ( !width)) (define-class () (width #:accessor !width #:init-keyword #:width #:init-value 0)) ;; foo.scm ends here [ drop this aside compile-me ./compile-me foo.scm 2.1.3.59-516f7 (merge-generics replace warn-override-core warn last) I compiled you: foo.scm A modified version of the guild script to (eval-when ...), then 'guild comp= ile foo.scm fails as reported in earlier. Note that it does not matter whether = the module uses goops, import more then one and effectively merge generics, it = simply fails, as reported in the first email of this thread. So if you keep this API we are talking about here, and I really think we sh= ould, I can write and use my own script to compile my modules. I'd be curious to un= derstand why guild, modified as described above, did work in 2.0.11, 2.0.12, 2.1.2, = but fails with 2.1.3, but I also understand if you are not interested. Cheers, David --Sig_/tDcdEEwqQ+h5kl76Sip3uaq Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJXlXu4AAoJEPN0/ZOjBXrX4U8IALII5pZFOvlO0xQSODnIVWii OI4fIHrFy05osu3pylBnLxaEkIFEyrIdiaz2LnschsTGKknhQIff9qWBVEf9j8RS nVg/KUV1fmzozZMiWZLyOAGW6av3WPAQWV2z6mfaA4HrZt5hDP9aTUzDDlz9nPXY eKoO9r6M/5aA4HqcMFpjoHbanxI/FgnB3f937nsOiom8tGGc4lJ2RoTESMlHitUh wlvY+mqWSSMIJtLf6CXJNGMOe6n7xYtnqRaMntF43eKb4fMhWf8dq05PoXK7w948 4KG0iUNaZipQgmdEkTfav71mBrCkXkry2tkK/BKnmbIJ0Yxh46sZe7h+WBI4E9s= =Vhm1 -----END PGP SIGNATURE----- --Sig_/tDcdEEwqQ+h5kl76Sip3uaq--