From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.bugs Subject: bug#20093: master: setting merge-generics duplicate-binding-handler @ expand time raises an error Date: Thu, 07 Jul 2016 11:54:51 +0200 Message-ID: <87d1mp7oyc.fsf@pobox.com> References: <20150312001718.5d1ae438@capac> <87k2hfopyc.fsf@pobox.com> <20160703191007.0e4d2471@capac> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1467885394 17649 80.91.229.3 (7 Jul 2016 09:56:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 7 Jul 2016 09:56:34 +0000 (UTC) Cc: 20093@debbugs.gnu.org To: David Pirotte Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Thu Jul 07 11:56: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 1bL62d-0003Am-TN for guile-bugs@m.gmane.org; Thu, 07 Jul 2016 11:56:20 +0200 Original-Received: from localhost ([::1]:38530 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bL62X-000541-L6 for guile-bugs@m.gmane.org; Thu, 07 Jul 2016 05:56:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42354) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bL62R-00053r-KW for bug-guile@gnu.org; Thu, 07 Jul 2016 05:56:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bL62M-00016R-QF for bug-guile@gnu.org; Thu, 07 Jul 2016 05:56:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:56108) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bL62M-00016N-Lr for bug-guile@gnu.org; Thu, 07 Jul 2016 05:56:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bL62M-0004bB-EG for bug-guile@gnu.org; Thu, 07 Jul 2016 05:56:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andy Wingo Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Thu, 07 Jul 2016 09: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.146788530817616 (code B ref 20093); Thu, 07 Jul 2016 09:56:02 +0000 Original-Received: (at 20093) by debbugs.gnu.org; 7 Jul 2016 09:55:08 +0000 Original-Received: from localhost ([127.0.0.1]:40212 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bL61U-0004a4-9J for submit@debbugs.gnu.org; Thu, 07 Jul 2016 05:55:08 -0400 Original-Received: from pb-sasl2.pobox.com ([64.147.108.67]:55805 helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bL61Q-0004Zs-3K for 20093@debbugs.gnu.org; Thu, 07 Jul 2016 05:55:06 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-sasl2.pobox.com (Postfix) with ESMTP id 68E29202F6; Thu, 7 Jul 2016 05:55:02 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=wC94pssfXi0fFq+4IADGwN9R9Sg=; b=Bpp3CA QJKZ07329Fbqc3ZShtFMknq2KeOEzekBYm/jfW5BdesMEY10w2WUkRKFuYI5RCR/ /ImA+m855J0/3uRhe1m9Z8TxBKeRvz79DgSsKIM4wb109uC/irlkBTqBoM+nPmLe QmOHg33So6X/CIhQB7ygpaXq6y6SzMBSsFo8w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=htXBjqn6j3X6AEjgU9Yaw7U3p9Rd2AfH 3Anfp+gtNqfGQeDejSEr9+zsEox1k70NOIFnQG12SwYyxRptsxLhWOfyS69S4LVj xsCpWrVZkhtaqkeK3hnwgU1XqWBJwO/ecCZlvQMGeWz25wp50HtBAWXp5uujSusL bX0pSW/94cw= Original-Received: from pb-sasl2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-sasl2.pobox.com (Postfix) with ESMTP id 5EB42202F5; Thu, 7 Jul 2016 05:55:02 -0400 (EDT) Original-Received: from clucks (unknown [88.160.190.192]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pb-sasl2.pobox.com (Postfix) with ESMTPSA id 63745202F2; Thu, 7 Jul 2016 05:55:00 -0400 (EDT) In-Reply-To: <20160703191007.0e4d2471@capac> (David Pirotte's message of "Sun, 3 Jul 2016 19:10:07 -0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) X-Pobox-Relay-ID: DEADC6BC-4428-11E6-9A98-28A6F1301B6D-02397024!pb-sasl2.pobox.com 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:8275 Archived-At: On Mon 04 Jul 2016 00:10, David Pirotte writes: >> 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. > > I disagree with the way you [now' re-] interpret things: if a module has no > #:duplicates declaration, it is implicitly specifying the duplicate handlers > returned by (default-duplicate-binding-handler), _not_ the one from the > manual. To clarify. I believe that the default should be what is in the manual, and have fixed Guile 2.2 in that regard. You think it should be the value of the dynamic parameter. There are two points at which the parameter could be captured: when the module is defined, or lazily, when the first duplicate binding pair is detected. The latter leads to bugs of many kinds, like this bug. So, I assume you are proposing to capture the value of the dynamic parameter when the module is defined. This has two bugs however. * Modules are defined two times in general: once when compiling and once when loading. It is too difficult to get the parameter to work when compiling; you have to do invoke (default-duplicate-binding-handler) at the top of each file you compile, at which point you might as well just specify #:duplicates. * Global dynamic parameters that affect the substance of a module and the shape of its exports are not modular and cannot be set in a modular way. If your module depends on a particular duplicates handler, you need to specify that explicitly -- otherwise a user of your module might want something different in general, and then your code would break. >> 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 :) > > This breaks all my code, with no other option but maintaining my own > boot-9 version: I really wish I can avoid that, could you reconsider? [no, I don't > want to have to use #:duplicates, since I _always_ [like always always always] want > my modules to grab my global setting and default]. I feel your pain but I think that the proper solution is to just go through your modules and add the #:duplicates argument. It is forward and backward compatible. I also feel the need to say that while you are welcome to fork Guile in any way that you like, I will not look at any bugs from a forked Guile. Regards, Andy