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, 23 Jun 2016 18:00:27 +0200 Message-ID: <87k2hfopyc.fsf@pobox.com> References: <20150312001718.5d1ae438@capac> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1466697861 7640 80.91.229.3 (23 Jun 2016 16:04:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 23 Jun 2016 16:04:21 +0000 (UTC) Cc: 20093-done@debbugs.gnu.org To: David Pirotte Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Thu Jun 23 18:04:11 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 1bG76w-0005ph-6u for guile-bugs@m.gmane.org; Thu, 23 Jun 2016 18:04:10 +0200 Original-Received: from localhost ([::1]:37745 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bG76v-0001zl-DL for guile-bugs@m.gmane.org; Thu, 23 Jun 2016 12:04:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60794) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bG740-0007tQ-CO for bug-guile@gnu.org; Thu, 23 Jun 2016 12:01:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bG73u-00012T-IN for bug-guile@gnu.org; Thu, 23 Jun 2016 12:01:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:40502) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bG73u-00012N-BP for bug-guile@gnu.org; Thu, 23 Jun 2016 12:01:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bG73u-0005nB-2D for bug-guile@gnu.org; Thu, 23 Jun 2016 12:01:02 -0400 Resent-From: Andy Wingo Original-Sender: "Debbugs-submit" Resent-To: bug-guile@gnu.org Resent-Date: Thu, 23 Jun 2016 16:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 20093 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Mail-Followup-To: 20093@debbugs.gnu.org, wingo@pobox.com, david@altosw.be Original-Received: via spool by 20093-done@debbugs.gnu.org id=D20093.146669763922224 (code D ref 20093); Thu, 23 Jun 2016 16:01:01 +0000 Original-Received: (at 20093-done) by debbugs.gnu.org; 23 Jun 2016 16:00:39 +0000 Original-Received: from localhost ([127.0.0.1]:52839 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bG73W-0005mO-Op for submit@debbugs.gnu.org; Thu, 23 Jun 2016 12:00:39 -0400 Original-Received: from pb-sasl1.pobox.com ([64.147.108.66]:64755 helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bG73V-0005mG-N0 for 20093-done@debbugs.gnu.org; Thu, 23 Jun 2016 12:00:38 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id 0F4C12425C; Thu, 23 Jun 2016 12:00:36 -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=D/QT++DdCh0N/9wdvbJA4pnvLWo=; b=tS/mB1 xMc017Ou+oJ50VFLTRZFXlNuBm8QoOXvVb+EHGHDozF9EMHrMiJfsqBEQiZg8Y/U qJA7m12vQxMPcxx86VENmy+9LVdBRjGx8LhYNMw3+9+gg35lPY/9iqbxnBS78ZFu cruvtntpoODYoUbQmvakbD2dMBN29bj6E8DOg= 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=Qe63tClkppaYH+O4UAP25cG/7H6jiIw+ mxm3WzIofeuUfHRljJNbp4/vyW+T9UPkiUIO9L4XDzFwOefeKK01gG/CXEH05Nle 9JRdCvjYr5PFDvTkn4OzAvrIELFVWioY5MV+oDj3pTa6hndW/bOQ8p8TXXC9u+D3 N12bseyRbis= Original-Received: from pb-sasl1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id EA8B72425A; Thu, 23 Jun 2016 12:00:35 -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-sasl1.pobox.com (Postfix) with ESMTPSA id E235F24255; Thu, 23 Jun 2016 12:00:34 -0400 (EDT) In-Reply-To: <20150312001718.5d1ae438@capac> (David Pirotte's message of "Thu, 12 Mar 2015 00:17:18 -0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) X-Pobox-Relay-ID: 9EE6C22C-395B-11E6-8B33-C1836462E9F6-02397024!pb-sasl1.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:8165 Archived-At: Hi, 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. 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. 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 :) Andy On Thu 12 Mar 2015 04:17, David Pirotte writes: > Hello guilers, > Hi Andy, > > Following our brief chat on irc, yesterday, here is he bug I was referring to: > > GNU Guile 2.1.0.322-eb3d6 > > setting merge-generics duplicate-binding-handler @ expand time raises an > error. > > a) here is a short test case: > > #! /bin/sh > # -*- mode: scheme; coding: utf-8 -*- > exec guile -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))) > > (define (main args) > (display "hello\n")) > > => > > david@capac:~/alto/projects/guile-tests/2.2/goops/duplicate-binding-handler 76 $ ./hello > ;;; note: source file /usr/alto/projects/guile-tests/2.2/goops/duplicate-binding-handler/./hello > ;;; newer than compiled /home/david/.cache/guile/ccache/2.2-LE-8-3.6/usr/alto/projects/guile-tests/2.2/goops/duplicate-binding-handler/hello.go > ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0 > ;;; or pass the --no-auto-compile argument to disable. > ;;; compiling /usr/alto/projects/guile-tests/2.2/goops/duplicate-binding-handler/./hello > ;;; WARNING: compilation of /usr/alto/projects/guile-tests/2.2/goops/duplicate-binding-handler/./hello failed: > ;;; ERROR: No applicable method for #< merge-generics (3)> in call Error while printing exception. > hello! > > > b) here is how it propagates, 'just' trying to import 2 gnome modules: > > #! /bin/sh > # -*- mode: scheme; coding: utf-8 -*- > exec guile -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 (gnome-2) > (gnome gobject) > (gnome glib)) > > (define (main args) > (display "hello!\n")) > > => > > david@capac:~/alto/projects/guile-tests/2.2/goops/duplicate-binding-handler 40 $ ./hello > ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0 > ;;; or pass the --no-auto-compile argument to disable. > ;;; compiling /usr/alto/projects/guile-tests/2.2/goops/duplicate-binding-handler/./hello > ;;; WARNING: compilation of /usr/alto/projects/guile-tests/2.2/goops/duplicate-binding-handler/./hello failed: > ;;; ERROR: No applicable method for #< merge-generics (3)> in call Error while printing exception. > Backtrace: > In ice-9/boot-9.scm: > 3275: 19 [try-module-autoload _ _] > 2611: 18 [save-module-excursion #] > 3295: 17 [#] > In unknown file: > ?: 16 [primitive-load-path "gnome/gw/glib" #] > In gnome/gw/glib.scm: > 15: 15 [#] > In unknown file: > ?: 14 [load-extension "libgw-guile-gnome-glib" "gw_init_wrapset_gnome_glib"] > In ice-9/boot-9.scm: > 2999: 13 [#> # _ _ ...] > 3275: 12 [try-module-autoload _ _] > 2611: 11 [save-module-excursion #] > 3295: 10 [#] > In unknown file: > ?: 9 [primitive-load-path "gnome/gw/generics" #] > In gnome/gw/generics.scm: > 35: 8 [#f] > In ice-9/boot-9.scm: > 3136: 7 [define-module* _ #:filename _ #:pure _ #:version _ #:duplicates ...] > 3074: 6 [resolve-interface (gnome gobject generics) #:select ...] > 2999: 5 [#> # _ _ ...] > 3275: 4 [try-module-autoload _ _] > 2611: 3 [save-module-excursion #] > 3295: 2 [#] > In unknown file: > ?: 1 [primitive-load-path "gnome/gobject/generics" ...] > In gnome/gobject/generics.scm: > 130: 0 [()] > > gnome/gobject/generics.scm:130:0: In procedure (): > gnome/gobject/generics.scm:130:0: In procedure module-lookup: Unbound variable: > david@capac:~/alto/projects/guile-tests/2.2/goops/duplicate-binding-handler 41 $ > > > Cheers, > David