GNU logs - #19459, boring messages


Message sent to bug-guile@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#19459: #:export does not honor the merge-generics contract
Resent-From: David Pirotte <david@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-guile@HIDDEN
Resent-Date: Sun, 28 Dec 2014 18:22:01 +0000
Resent-Message-ID: <handler.19459.B.141979086518854 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 19459
X-GNU-PR-Package: guile
X-GNU-PR-Keywords: 
To: 19459 <at> debbugs.gnu.org
X-Debbugs-Original-To: <bug-guile@HIDDEN>
Received: via spool by submit <at> debbugs.gnu.org id=B.141979086518854
          (code B ref -1); Sun, 28 Dec 2014 18:22:01 +0000
Received: (at submit) by debbugs.gnu.org; 28 Dec 2014 18:21:05 +0000
Received: from localhost ([127.0.0.1]:59937 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Y5ISe-0004u2-Af
	for submit <at> debbugs.gnu.org; Sun, 28 Dec 2014 13:21:04 -0500
Received: from eggs.gnu.org ([208.118.235.92]:45314)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <david@HIDDEN>) id 1Y5ISc-0004tu-RB
 for submit <at> debbugs.gnu.org; Sun, 28 Dec 2014 13:21:03 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <david@HIDDEN>) id 1Y5ISb-0000VZ-Dx
 for submit <at> debbugs.gnu.org; Sun, 28 Dec 2014 13:21:02 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled
 version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:46497)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <david@HIDDEN>) id 1Y5ISb-0000VT-BD
 for submit <at> debbugs.gnu.org; Sun, 28 Dec 2014 13:21:01 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:47036)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <david@HIDDEN>) id 1Y5ISa-0002SL-0m
 for bug-guile@HIDDEN; Sun, 28 Dec 2014 13:21:01 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <david@HIDDEN>) id 1Y5ISW-0000Uy-O1
 for bug-guile@HIDDEN; Sun, 28 Dec 2014 13:20:59 -0500
Received: from maximusconfessor.all2all.org ([79.99.200.102]:51465)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <david@HIDDEN>) id 1Y5ISW-0000SD-FJ
 for bug-guile@HIDDEN; Sun, 28 Dec 2014 13:20:56 -0500
Received: from localhost (unknown [192.168.0.2])
 by maximusconfessor.all2all.org (Postfix) with ESMTP id 6160FA04C250
 for <bug-guile@HIDDEN>; Sun, 28 Dec 2014 19:20:34 +0100 (CET)
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 <bug-guile@HIDDEN>;
 Sun, 28 Dec 2014 18:57:02 +0100 (CET)
Received: from capac (unknown [179.210.40.164])
 by maximusconfessor.all2all.org (Postfix) with ESMTPSA id E33B9A04C258
 for <bug-guile@HIDDEN>; Sun, 28 Dec 2014 19:20:26 +0100 (CET)
Date: Sun, 28 Dec 2014 16:20:24 -0200
From: David Pirotte <david@HIDDEN>
Message-ID: <20141228162024.048ca208@capac>
X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
 boundary="Sig_/vOYtH6x_Yv+tT9Ug8btPg2Y"; protocol="application/pgp-signature"
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-Received-From: 2001:4830:134:3::11
X-Spam-Score: -5.0 (-----)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

--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@HIDDEN/msg126=
18.html

Happy hacking,
David

;; module a starts here
(define-module (a)
  #:use-module (oop goops)
  #:export (<a>
	    !width
	    get-width
	    set-width))


(define-class <a> ()
  (width #:accessor !width #:init-keyword #:width #:init-value 0))

(define-method (get-width (self <a>))
  (!width self))

(define-method (set-width (self <a>) width)
  (set! (!width self) width))
;;  module a ends here


;; module b starts here
(define-module (b)
  #:use-module (oop goops)
  #:use-module (a)
  #:export (<b>
	    !width
	    get-width
	    set-width))


(define-class <b> ()
  (width #:accessor !width #:init-keyword #:width #:init-value 0))

(define-method (initialize (self <b>) initargs)
  (next-method) =20
  (let ((a (make <a>)))
    (set-width self (get-width a))
    #;(add-child b a)))

(define-method (get-width (self <b>))
  (!width self))

(define-method (set-width (self <b>) 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 <b>)
ERROR: In procedure scm-error:
ERROR: No applicable method for #<<generic> get-width (1)> in call (get-wid=
th #<<a> 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 (#<procedure 2854c80 at oop/goops.scm:1551:0 (class . initargs=
)> #<<class> <b> 28cb8=E2=80=A6>)
In guile-tests/goops/export/b.scm:
    17:20  2 (#<procedure 2b708e0 at guile-tests/goops/export/b.scm:14:0 (s=
elf initargs)> #<<=E2=80=A6> =E2=80=A6)
In oop/goops/dispatch.scm:
    239:9  1 (cache-miss #<<generic> get-width (1)> (#<<a> 2b70880>))
In unknown file:
           0 (scm-error goops-error #f "No applicable method for ~S in call=
 ~S" (#<<generic> =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--




Message sent:


Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Mailer: MIME-tools 5.503 (Entity 5.503)
Content-Type: text/plain; charset=utf-8
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: David Pirotte <david@HIDDEN>
Subject: bug#19459: Acknowledgement (#:export does not honor the
 merge-generics contract)
Message-ID: <handler.19459.B.141979086518854.ack <at> debbugs.gnu.org>
References: <20141228162024.048ca208@capac>
X-Gnu-PR-Message: ack 19459
X-Gnu-PR-Package: guile
Reply-To: 19459 <at> debbugs.gnu.org
Date: Sun, 28 Dec 2014 18:22:01 +0000

Thank you for filing a new bug report with debbugs.gnu.org.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
 bug-guile@HIDDEN

If you wish to submit further information on this problem, please
send it to 19459 <at> debbugs.gnu.org.

Please do not send mail to help-debbugs@HIDDEN unless you wish
to report a problem with the Bug-tracking system.

--=20
19459: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D19459
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems


Message sent to bug-guile@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#19459: #:export does not honor the merge-generics contract
Resent-From: Andy Wingo <wingo@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-guile@HIDDEN
Resent-Date: Wed, 22 Jun 2016 20:22:02 +0000
Resent-Message-ID: <handler.19459.B19459.146662692122726 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 19459
X-GNU-PR-Package: guile
X-GNU-PR-Keywords: 
To: David Pirotte <david@HIDDEN>
Cc: 19459 <at> debbugs.gnu.org
Received: via spool by 19459-submit <at> debbugs.gnu.org id=B19459.146662692122726
          (code B ref 19459); Wed, 22 Jun 2016 20:22:02 +0000
Received: (at 19459) by debbugs.gnu.org; 22 Jun 2016 20:22:01 +0000
Received: from localhost ([127.0.0.1]:51527 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bFoev-0005uU-Eo
	for submit <at> debbugs.gnu.org; Wed, 22 Jun 2016 16:22:01 -0400
Received: from pb-sasl1.pobox.com ([64.147.108.66]:57568
 helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <wingo@HIDDEN>) id 1bFoet-0005uM-GJ
 for 19459 <at> debbugs.gnu.org; Wed, 22 Jun 2016 16:22:00 -0400
Received: from sasl.smtp.pobox.com (unknown [127.0.0.1])
 by pb-sasl1.pobox.com (Postfix) with ESMTP id CD1D222FBC;
 Wed, 22 Jun 2016 16:21:56 -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=bpj4XO1ozgjVn45Zm/gVr3FQ0vg=; b=DDsg2a
 k8mIvhCZ2jOFCA355YnsAcOS6wF5PE+Ap4I03eW5yAtMcl8x85HWCSi4M8O82hHh
 dSClrwz5PxwbgcKDF6Aq+9f1mv372LU9gnx0qqXwFdyOHdwSlVonHJGAPbg21E+P
 IJJeQgG+Jk88/s5X6DW6f6YRDaJtgsdoP5ins=
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=Kjw/XvNxm83Q1n8QJeeVPN5YlhTpzUUX
 znCJZLHPbW15Bf1anv0cwOzeo4kdGcbjvrtvKOyJ9jE1KCLRZ5CiuCWDC3nwRwKl
 S+NELacnlYwGM6IlaXztTFuvZlSKOXgVFVRf5L/q0Unc3bpMZ1u2FikFI+tGXwVB
 RogEPNjjMJI=
Received: from pb-sasl1.nyi.icgroup.com (unknown [127.0.0.1])
 by pb-sasl1.pobox.com (Postfix) with ESMTP id C663B22FBB;
 Wed, 22 Jun 2016 16:21:56 -0400 (EDT)
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 D3B2A22FBA;
 Wed, 22 Jun 2016 16:21:55 -0400 (EDT)
From: Andy Wingo <wingo@HIDDEN>
References: <20141228162024.048ca208@capac>
Date: Wed, 22 Jun 2016 22:21:48 +0200
In-Reply-To: <20141228162024.048ca208@capac> (David Pirotte's message of "Sun, 
 28 Dec 2014 16:20:24 -0200")
Message-ID: <87vb11q8ir.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Pobox-Relay-ID: F714694A-38B6-11E6-B7B6-C1836462E9F6-02397024!pb-sasl1.pobox.com
X-Spam-Score: -1.4 (-)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.4 (-)

Hi,

On Sun 28 Dec 2014 19:20, David Pirotte <david@HIDDEN> writes:

> (define-module (a)
>   #:use-module (oop goops)
>   #:export (<a>
> 	    !width
> 	    get-width
> 	    set-width))

Here you export four bindings: one class and three generics.  Those
three generics have methods on <a>.

> (define-module (b)
>   #:use-module (oop goops)
>   #:use-module (a)

Here you import the previous four bindings.

>   #:export (<b>
> 	    !width
> 	    get-width
> 	    set-width))

However here you declare that you are going to export four new
bindings.  I believe this is the source of your problem.  You are
expecting to extend the three generics and re-export them.  However to
do so you should #:re-export !width, get-width, and set-width.

AFAIU there is no bug here.  David WDYT?

Andy




Message sent to bug-guile@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#19459: #:export does not honor the merge-generics contract
Resent-From: David Pirotte <david@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-guile@HIDDEN
Resent-Date: Thu, 23 Jun 2016 19:24:02 +0000
Resent-Message-ID: <handler.19459.B19459.146670982016471 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 19459
X-GNU-PR-Package: guile
X-GNU-PR-Keywords: 
To: Andy Wingo <wingo@HIDDEN>
Cc: 19459 <at> debbugs.gnu.org
Received: via spool by 19459-submit <at> debbugs.gnu.org id=B19459.146670982016471
          (code B ref 19459); Thu, 23 Jun 2016 19:24:02 +0000
Received: (at 19459) by debbugs.gnu.org; 23 Jun 2016 19:23:40 +0000
Received: from localhost ([127.0.0.1]:52998 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bGAE0-0004Hb-AF
	for submit <at> debbugs.gnu.org; Thu, 23 Jun 2016 15:23:40 -0400
Received: from maximusconfessor.all2all.org ([79.99.200.102]:53415)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <david@HIDDEN>) id 1bGADy-0004HS-5E
 for 19459 <at> debbugs.gnu.org; Thu, 23 Jun 2016 15:23:38 -0400
Received: from localhost (unknown [192.168.0.2])
 by maximusconfessor.all2all.org (Postfix) with ESMTP id 31661A04C13D;
 Thu, 23 Jun 2016 21:23:36 +0200 (CEST)
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 ppjsVzsImVpd; Thu, 23 Jun 2016 21:23:31 +0200 (CEST)
Received: from capac (unknown [179.210.35.216])
 by maximusconfessor.all2all.org (Postfix) with ESMTPSA id A3C25A04C13F;
 Thu, 23 Jun 2016 21:23:30 +0200 (CEST)
Date: Thu, 23 Jun 2016 16:23:21 -0300
From: David Pirotte <david@HIDDEN>
Message-ID: <20160623162321.448e47af@capac>
In-Reply-To: <87vb11q8ir.fsf@HIDDEN>
References: <20141228162024.048ca208@capac>
	<87vb11q8ir.fsf@HIDDEN>
X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
 boundary="Sig_/hVPSJ7QlDNQRLHp8jXzEfYl"; protocol="application/pgp-signature"
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

--Sig_/hVPSJ7QlDNQRLHp8jXzEfYl
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

Hi Andy,

> > (define-module (a)
> >   #:use-module (oop goops)
> >   #:export (<a>
> > 	    !width
> > 	    get-width
> > 	    set-width)) =20

> Here you export four bindings: one class and three generics.  Those
> three generics have methods on <a>.

> > (define-module (b)
> >   #:use-module (oop goops)
> >   #:use-module (a) =20

> Here you import the previous four bindings.

> >   #:export (<b>
> > 	    !width
> > 	    get-width
> > 	    set-width)) =20

> However here you declare that you are going to export four new
> bindings.
> ...

Under the exact circumstances of the original email, I disagree, see below.

	From the original email, you only kept the module defs and explains here i=
n your
	answer the expected behavior in normal circumstances: the behavior one can
	expect from the default Guile configuration. Fine, but that's not the what
	the original email was complaining about :)

> AFAIU there is no bug here.  David WDYT?

IMO it is a bug, and to be honest, IMO it is a serious one: a user should n=
ever have
to use #:re-export for generic functions once he/she did ask to merge dupli=
cate
generics, because under this setting, there can be 1 and only 1 generic fun=
ction, at
any time in any module. Under these circumstances, it is the generic functi=
on as the
module 'sees it' that the user export, not the generic function as the modu=
le sees
it before import(s)

	if imported, then that generic is 'filled in' with new methods, it is _not_
	created [should not be created], hence #:export is the 'culprit', because =
as
	it is it does not look if a generic exists and create a new one arbitraril=
y,
	against the user 'wish'. It can only do so if there is no imported one.

So, IMO, under the '(merge-generics ...) setting of the original email (b) =
exports 1
new binding and 3 generic functions that were already defined by (a), but/a=
nd
'filled' with 3 additional methods. The module (b) exports the generic func=
tion 'as
it has it'.

There is another way, maybe, to look at this anomaly: if you comment the ex=
port for
get-width and set-width from the (b) module, it works:

	scheme@(guile-user)> ,use (b)
	scheme@(guile-user)> (make <b>)
	$4 =3D #<<b> 2051a40>

because within the module (b), the generics set-width and get-width were im=
ported
from (a), not created [or 'immediately' merged, implementation detail...], =
and filed
with the (b) methods. #:export however dismantle this to export a new gener=
ic [but
the user ask to merge them, so it breaks the user 'contract'] only containi=
ng the (b)
methods, which is a bug.

Last but not least, when a user imports (b) and run (make <b>), he is not h=
imself
calling set-width or get-width: exported or not, the code being run by make=
 should
run within the (b) module, and in the (b) module the generic functions have=
 been
merged,, so can not [should] raise an error. If you follow your idea/positi=
on, it
should only raise an error if I do (get-width (make <a>)) [but then the sys=
tem might
raise the undefined <a> class first..., but you get the idea I guess.

FIWIW, It's been years that I don't use #:export because of this bug, I def=
ined my
own g-export syntax, based on guile's module source code, here:

	http://git.savannah.gnu.org/cgit/grip.git/tree/grip/g-export.scm

It would be really good if it be fixed in 2.0.12 and master though.

Cheers,
David

--Sig_/hVPSJ7QlDNQRLHp8jXzEfYl
Content-Type: application/pgp-signature
Content-Description: OpenPGP digital signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJXbDcpAAoJEPN0/ZOjBXrXhPMH/REXriGmZ/2ClsL1fRKQ03FI
vq67r/ZZS4V+oHvFhtXY8/crhKJdlo89LydsvBIWPn0zM3XAoCjFdCFjgvbUJrFe
5+CFH4n/D3ii9pjRqawRU7cGZHs9epgatmZEcCl+Gx/A1zkK17eMgXthYtR2hcxy
SO8R1E4t1qJvir1GK9bmX1Lu0NnZ/JD6mT+qDoVFNU88H2hvSsAxYH/8eh7kLCz+
CSL/Q4qzRPnEiHeGVadjq8UwhW0Qa1msh2p/IeWfTMMpoP8cE5fMNPLacImEOhSX
fOvSD4aylrGRZjyYGCvDmGb9/NCAcgnV1YT2/rUSuqwn/5ouw4CfwPQnjj1XtX4=
=/hoT
-----END PGP SIGNATURE-----

--Sig_/hVPSJ7QlDNQRLHp8jXzEfYl--




Message sent to bug-guile@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#19459: #:export does not honor the merge-generics contract
Resent-From: Andy Wingo <wingo@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-guile@HIDDEN
Resent-Date: Thu, 23 Jun 2016 20:07:01 +0000
Resent-Message-ID: <handler.19459.B19459.146671240020634 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 19459
X-GNU-PR-Package: guile
X-GNU-PR-Keywords: 
To: David Pirotte <david@HIDDEN>
Cc: 19459 <at> debbugs.gnu.org
Received: via spool by 19459-submit <at> debbugs.gnu.org id=B19459.146671240020634
          (code B ref 19459); Thu, 23 Jun 2016 20:07:01 +0000
Received: (at 19459) by debbugs.gnu.org; 23 Jun 2016 20:06:40 +0000
Received: from localhost ([127.0.0.1]:53013 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bGAtc-0005Mk-Bn
	for submit <at> debbugs.gnu.org; Thu, 23 Jun 2016 16:06:40 -0400
Received: from pb-sasl2.pobox.com ([64.147.108.67]:62318
 helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <wingo@HIDDEN>) id 1bGAta-0005Mc-KN
 for 19459 <at> debbugs.gnu.org; Thu, 23 Jun 2016 16:06:39 -0400
Received: from sasl.smtp.pobox.com (unknown [127.0.0.1])
 by pb-sasl2.pobox.com (Postfix) with ESMTP id 38F69244D9;
 Thu, 23 Jun 2016 16:06: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=TRQCOC+yywRFEB3KFbE14zuYETY=; b=Lbl6oZ
 AxtOGu+yXI9ZTGVlVlZKOKexAtjD3WhZ5hyuTr483v7uJ9XqrMHlqGu3jpJCQDmc
 nqR/nfRhWoKrePDFWo/UwekTi0jW8TALoimo2F9tuu8qwKYtNEeLYi7RgQxnwS6g
 A6rnUrsAYM3iT8Hm4EBDyauf/h0VOdQfVAhjM=
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=kUklK4C9otXx6jRYyIXyzFm40+hQUC7o
 UqPcL2s+0Wobbo2oeStAnlQieFHXwh9d3+H20aqlPZ01jsQ4BYZFHWCzH6j2mtlD
 RurxR45bmHScZZDce8VYNwe15DAwRPQ4O+MMDw+lGvtgn7xRt2NEljJGelLjJYo7
 P+JTI4PqPk0=
Received: from pb-sasl2.nyi.icgroup.com (unknown [127.0.0.1])
 by pb-sasl2.pobox.com (Postfix) with ESMTP id 22C62244D7;
 Thu, 23 Jun 2016 16:06:36 -0400 (EDT)
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 448EA244D6;
 Thu, 23 Jun 2016 16:06:35 -0400 (EDT)
From: Andy Wingo <wingo@HIDDEN>
References: <20141228162024.048ca208@capac> <87vb11q8ir.fsf@HIDDEN>
 <20160623162321.448e47af@capac>
Date: Thu, 23 Jun 2016 22:06:27 +0200
In-Reply-To: <20160623162321.448e47af@capac> (David Pirotte's message of "Thu, 
 23 Jun 2016 16:23:21 -0300")
Message-ID: <87oa6rllfg.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Pobox-Relay-ID: FCB66CF0-397D-11E6-9213-28A6F1301B6D-02397024!pb-sasl2.pobox.com
X-Spam-Score: -1.4 (-)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.4 (-)

On Thu 23 Jun 2016 21:23, David Pirotte <david@HIDDEN> writes:

> Hi Andy,
>
>> > (define-module (a)
>> >   #:use-module (oop goops)
>> >   #:export (<a>
>> > 	    !width
>> > 	    get-width
>> > 	    set-width))  
>
>> Here you export four bindings: one class and three generics.  Those
>> three generics have methods on <a>.
>
>> > (define-module (b)
>> >   #:use-module (oop goops)
>> >   #:use-module (a)  
>
>> Here you import the previous four bindings.
>
>> >   #:export (<b>
>> > 	    !width
>> > 	    get-width
>> > 	    set-width))  
>
>> However here you declare that you are going to export four new
>> bindings.
>> ...
>
> Under the exact circumstances of the original email, I disagree, see below.

I see.  You were expecting for the dynamically setting the
default-duplicate-binding-handler parameter to make a difference.
However I think this is maybe not the right way to set this up; see
reasoning in http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20093.

However... I believe merge-generics is intended to merge duplicate
imported bindings.  It does not provide a copy-on-write version of an
imported generic, if that generic was not duplicated in the imports.
There is no facility in GOOPS to do that, AFAIU.

Did I get it right this time? :)

Andy




Message sent to bug-guile@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#19459: #:export does not honor the merge-generics contract
Resent-From: David Pirotte <david@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-guile@HIDDEN
Resent-Date: Thu, 23 Jun 2016 21:12:02 +0000
Resent-Message-ID: <handler.19459.B19459.146671627826716 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 19459
X-GNU-PR-Package: guile
X-GNU-PR-Keywords: 
To: Andy Wingo <wingo@HIDDEN>
Cc: 19459 <at> debbugs.gnu.org
Received: via spool by 19459-submit <at> debbugs.gnu.org id=B19459.146671627826716
          (code B ref 19459); Thu, 23 Jun 2016 21:12:02 +0000
Received: (at 19459) by debbugs.gnu.org; 23 Jun 2016 21:11:18 +0000
Received: from localhost ([127.0.0.1]:53066 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bGBuA-0006wq-9A
	for submit <at> debbugs.gnu.org; Thu, 23 Jun 2016 17:11:18 -0400
Received: from maximusconfessor.all2all.org ([79.99.200.102]:55892)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <david@HIDDEN>) id 1bGBu8-0006wh-BK
 for 19459 <at> debbugs.gnu.org; Thu, 23 Jun 2016 17:11:16 -0400
Received: from localhost (unknown [192.168.0.2])
 by maximusconfessor.all2all.org (Postfix) with ESMTP id 281A3A04C142;
 Thu, 23 Jun 2016 23:11:15 +0200 (CEST)
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 2n3Ah-HXBKGU; Thu, 23 Jun 2016 23:11:10 +0200 (CEST)
Received: from capac (unknown [179.210.35.216])
 by maximusconfessor.all2all.org (Postfix) with ESMTPSA id 88D8EA04C138;
 Thu, 23 Jun 2016 23:11:09 +0200 (CEST)
Date: Thu, 23 Jun 2016 18:11:03 -0300
From: David Pirotte <david@HIDDEN>
Message-ID: <20160623181103.00e09d95@capac>
In-Reply-To: <87oa6rllfg.fsf@HIDDEN>
References: <20141228162024.048ca208@capac> <87vb11q8ir.fsf@HIDDEN>
 <20160623162321.448e47af@capac> <87oa6rllfg.fsf@HIDDEN>
X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
 boundary="Sig_/mBZ/zBXiYnxtDrfmYCpM/ut"; protocol="application/pgp-signature"
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

--Sig_/mBZ/zBXiYnxtDrfmYCpM/ut
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable


> > Hi Andy,
> > =20
> >> > (define-module (a)
> >> >   #:use-module (oop goops)
> >> >   #:export (<a>
> >> > 	    !width
> >> > 	    get-width
> >> > 	    set-width))   =20
> > =20
> >> Here you export four bindings: one class and three generics.  Those
> >> three generics have methods on <a>. =20
> > =20
> >> > (define-module (b)
> >> >   #:use-module (oop goops)
> >> >   #:use-module (a)   =20
> > =20
> >> Here you import the previous four bindings. =20
> > =20
> >> >   #:export (<b>
> >> > 	    !width
> >> > 	    get-width
> >> > 	    set-width))   =20
> > =20
> >> However here you declare that you are going to export four new
> >> bindings.
> >> ... =20
> >
> > Under the exact circumstances of the original email, I disagree, see be=
low. =20
>=20
> I see.  You were expecting for the dynamically setting the
> default-duplicate-binding-handler parameter to make a difference.

Yes, and it has to: with that setting, at any time in any module, there can=
 be 1
and only 1 generic function for a given name:

	but as it is, right now, even with that setting, Guile is exporting
	'something' I did not ask to export, Guile is exporting a new binding,
	that I never asked to create [unless it would not be imported]

	from the (b) module perspective, I ask Guile to import (a), fill the gener=
ic
	functions with new methods, and export it, these generic functions, not new
	other ones

The symptom of the actual anomaly is very well expressed by my last sentenc=
e:

	"... last but not least, when a user imports (b) and run (make <b>), he is
	not himself calling set-width or get-width: exported or not, the code being
	run by make should run within the (b) module, and in the (b) module they c=
an
	be only 1 generic function, with the method of (a) and the method of (b)..=
."

This should never raise an exception:

	scheme@(guile-user)> ,use (b)
	scheme@(guile-user)> (make <b>)

Currently it does if the user used #:export, it does not if he/she does not=
 export

The problem is guile's module system, not GOOPS here

> However I think this is maybe not the right way to set this up; see
> reasoning in http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D20093.

	That is/was a totally different bug, but thanks for the fix! I disagree wi=
th
	the comment though, but I will pull, compile test it will take 1 or 2
	days... I hope it fixes it!

> However... I believe merge-generics is intended to merge duplicate
> imported bindings.  It does not provide a copy-on-write version of an
> imported generic, if that generic was not duplicated in the imports.
> There is no facility in GOOPS to do that, AFAIU.

It is a module bug, not a GOOPS bug, see my 'personal/local' fix: the probl=
em is
that once the user uses #:export, guile's module system create a new bindin=
g, and it
should not ... [hence this confusion as well: as it is: the module must mer=
ge its
definition with the imported ones, even if it imported only 1 generic ... b=
ecause of
a module bug...]

David




--Sig_/mBZ/zBXiYnxtDrfmYCpM/ut
Content-Type: application/pgp-signature
Content-Description: OpenPGP digital signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJXbFBnAAoJEPN0/ZOjBXrXV84IAKgyLdvldWCj5KeP/Lhr06OH
1S5IfTrIzCvuOFe69KYx/qTcbm3WizdEP2pseg1TRwm2HMT6lyUt5AZwtMTR+HBN
tZKprozadL0+yniU0BExK6Z5jvVjPb47q2RGxwzP7SoEzi5v1A36fJO52LEkI2P6
+nwEMypQSFBzhK7NjdGNRBf8+wGS+kIw2of+6lKEzf+WKnLjexLiTyz5np8h7NTm
LHLjOdx4k5t+58LcKSOP07L97ziC3iT0RMfjvS4/eOiQ33yed6PjrbDCNn5iSTvG
6ej7OFMjz04chu+Ni9ZrchsqCinno5n6HqhqXO+x3CVW8r/x9zql9iBcvs0LceU=
=TNUS
-----END PGP SIGNATURE-----

--Sig_/mBZ/zBXiYnxtDrfmYCpM/ut--




Message sent to bug-guile@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#19459: #:export does not honor the merge-generics contract
Resent-From: Andy Wingo <wingo@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-guile@HIDDEN
Resent-Date: Fri, 24 Jun 2016 05:13:01 +0000
Resent-Message-ID: <handler.19459.B19459.146674517719331 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 19459
X-GNU-PR-Package: guile
X-GNU-PR-Keywords: 
To: David Pirotte <david@HIDDEN>
Cc: 19459 <at> debbugs.gnu.org
Received: via spool by 19459-submit <at> debbugs.gnu.org id=B19459.146674517719331
          (code B ref 19459); Fri, 24 Jun 2016 05:13:01 +0000
Received: (at 19459) by debbugs.gnu.org; 24 Jun 2016 05:12:57 +0000
Received: from localhost ([127.0.0.1]:53215 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bGJQG-00051j-RS
	for submit <at> debbugs.gnu.org; Fri, 24 Jun 2016 01:12:57 -0400
Received: from pb-sasl1.pobox.com ([64.147.108.66]:61639
 helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <wingo@HIDDEN>) id 1bGJQF-00051V-Qc
 for 19459 <at> debbugs.gnu.org; Fri, 24 Jun 2016 01:12:56 -0400
Received: from sasl.smtp.pobox.com (unknown [127.0.0.1])
 by pb-sasl1.pobox.com (Postfix) with ESMTP id A80A526DC6;
 Fri, 24 Jun 2016 01:12:55 -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=OFqLUYE9fCpw0nga7X8IjXOTzwQ=; b=NdXZCC
 usfhfrsUKrbzuUWlHVg56EoDZBpYTVaxOhpO9xhzPwYBwQaY2qlmJetSOcwBn1Pp
 RMaLN2EQNuzp4jAfWiCL9Jwb0UmkDWw5eeaDdMj4FX49bxjHbL/zerytJjMELd00
 TNb4fIwv8G1MeywO7TnNNCKq0R0rYqTX/zw3o=
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=FBEQEba7hjkjBDrmhEcJ7zP+hnh0mVFF
 CqtoG2TWBZREY43tIGsoUPGQe2wN5UyZ/7O3Uhleq6IUAuL7EpIQWE6YRv299y3Q
 ip6CJSI21ndS1rHgNaGSS4CSSxI6c4PQ4nCCHf4VYcG8lGf4G58kCB6MLjNIF/lv
 jyBz6hCeNxU=
Received: from pb-sasl1.nyi.icgroup.com (unknown [127.0.0.1])
 by pb-sasl1.pobox.com (Postfix) with ESMTP id A053526DC5;
 Fri, 24 Jun 2016 01:12:55 -0400 (EDT)
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 E196D26DC4;
 Fri, 24 Jun 2016 01:12:54 -0400 (EDT)
From: Andy Wingo <wingo@HIDDEN>
References: <20141228162024.048ca208@capac> <87vb11q8ir.fsf@HIDDEN>
 <20160623162321.448e47af@capac> <87oa6rllfg.fsf@HIDDEN>
 <20160623181103.00e09d95@capac>
Date: Fri, 24 Jun 2016 07:02:31 +0200
In-Reply-To: <20160623181103.00e09d95@capac> (David Pirotte's message of "Thu, 
 23 Jun 2016 18:11:03 -0300")
Message-ID: <87twgjji1k.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Pobox-Relay-ID: 4EDA2156-39CA-11E6-B6A7-C1836462E9F6-02397024!pb-sasl1.pobox.com
X-Spam-Score: -1.4 (-)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.4 (-)

On Thu 23 Jun 2016 23:11, David Pirotte <david@HIDDEN> writes:

>> However... I believe merge-generics is intended to merge duplicate
>> imported bindings.  It does not provide a copy-on-write version of an
>> imported generic, if that generic was not duplicated in the imports.
>> There is no facility in GOOPS to do that, AFAIU.
>
> It is a module bug, not a GOOPS bug, see my 'personal/local' fix: the problem is
> that once the user uses #:export, guile's module system create a new binding, and it
> should not ... [hence this confusion as well: as it is: the module must merge its
> definition with the imported ones, even if it imported only 1 generic ... because of
> a module bug...]

I... I just think you're wrong here, sorry :/ That's just not how the
system works.  If you #:export an identifier in a module, you create a
fresh local binding, and that binding doesn't implicitly extend an
imported binding, merge-generics or no.  Merge-generics only operates on
the import interface of a module.

Andy




Message sent to bug-guile@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#19459: #:export does not honor the merge-generics contract
Resent-From: David Pirotte <david@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-guile@HIDDEN
Resent-Date: Mon, 27 Jun 2016 02:56:01 +0000
Resent-Message-ID: <handler.19459.B19459.146699612528527 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 19459
X-GNU-PR-Package: guile
X-GNU-PR-Keywords: 
To: Andy Wingo <wingo@HIDDEN>
Cc: 19459 <at> debbugs.gnu.org
Received: via spool by 19459-submit <at> debbugs.gnu.org id=B19459.146699612528527
          (code B ref 19459); Mon, 27 Jun 2016 02:56:01 +0000
Received: (at 19459) by debbugs.gnu.org; 27 Jun 2016 02:55:25 +0000
Received: from localhost ([127.0.0.1]:57294 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bHMhp-0007Q3-4M
	for submit <at> debbugs.gnu.org; Sun, 26 Jun 2016 22:55:25 -0400
Received: from maximusconfessor.all2all.org ([79.99.200.102]:47530)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <david@HIDDEN>) id 1bHMhl-0007Pr-Qq
 for 19459 <at> debbugs.gnu.org; Sun, 26 Jun 2016 22:55:23 -0400
Received: from localhost (unknown [192.168.0.2])
 by maximusconfessor.all2all.org (Postfix) with ESMTP id 76D16A04C114;
 Mon, 27 Jun 2016 04:55:09 +0200 (CEST)
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 Z3vnEo6vN7r0; Mon, 27 Jun 2016 04:55:05 +0200 (CEST)
Received: from capac (unknown [177.40.205.170])
 by maximusconfessor.all2all.org (Postfix) with ESMTPSA id 0AD8FA04C10C;
 Mon, 27 Jun 2016 04:55:01 +0200 (CEST)
Date: Sun, 26 Jun 2016 23:54:55 -0300
From: David Pirotte <david@HIDDEN>
Message-ID: <20160626235455.7726d721@capac>
In-Reply-To: <87twgjji1k.fsf@HIDDEN>
References: <20141228162024.048ca208@capac> <87vb11q8ir.fsf@HIDDEN>
 <20160623162321.448e47af@capac> <87oa6rllfg.fsf@HIDDEN>
 <20160623181103.00e09d95@capac> <87twgjji1k.fsf@HIDDEN>
X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
 boundary="Sig_/hO.=B9pt+6R8i2_3TBkz90x"; protocol="application/pgp-signature"
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

--Sig_/hO.=B9pt+6R8i2_3TBkz90x
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

Hello Andy,

> >> However... I believe merge-generics is intended to merge duplicate
> >> imported bindings.  It does not provide a copy-on-write version of an
> >> imported generic, if that generic was not duplicated in the imports.
> >> There is no facility in GOOPS to do that, AFAIU. =20

> > It is a module bug, not a GOOPS bug, see my 'personal/local' fix: the p=
roblem is
> > that once the user uses #:export, guile's module system create a new bi=
nding,
> > and it should not ... [hence this confusion as well: as it is: the modu=
le must
> > merge its definition with the imported ones, even if it imported only 1
> > generic ... because of a module bug...] =20

> I... I just think you're wrong here, sorry :/ That's just not how the
> system works.  If you #:export an identifier in a module, you create a
> fresh local binding, and that binding doesn't implicitly extend an
> imported binding, merge-generics or no.  Merge-generics only operates on
> the import interface of a module.

I don't think so, and I feel sorry too ;/. We disagree, which is different,=
 and
nobody is 'right' or 'wrong' here. [and I know 'how the system works, I des=
cribed
it that in the original email, I'd like to change that, hence this thread .=
..]

IMO, this should never fail:

	,use (b)
	make <b>

Your last sentence states that merge-generics only operates on the import i=
nterface
of a module: that is the feature I'm referring to to claim the above:

  [ using #:export ]

	t0	the system creates new 'empty' binding
		at some point 'it' knows it is a gf
	ti	it imports (a)

	now the (b) module interface is facing a duplicate gf binding, and accordi=
ng
	to the user settings wrt to this, it has to merge.

Then you tell me 'yep David, internally the system faced an import situatio=
n, and
ok, let's merge, _but_ #:export must export a fresh new ... I can buy that,=
 but
do we have the technology do implement this senario?=20

I believe, still referring to your last sentence, the above sentence as wel=
l and
respecting your position, that we should rather create/have global setting
'export-rexport-imported-gf' [or a better name.], WDYT?

Happy Hacking,
David

--Sig_/hO.=B9pt+6R8i2_3TBkz90x
Content-Type: application/pgp-signature
Content-Description: OpenPGP digital signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJXcJV/AAoJEPN0/ZOjBXrXio8H/2cqcZOhIdfiH8dffT6yk+fL
78XQrI4Nmzvfv/u4wTjJ+thqHilqjEQbcLy2JjI1QJNi4IMWQwPsD7pAvVSwt1ix
KMxrIVHh/ujOqK8alINV69F9X7+PURMEOwt00IhvfHAjN+Rfg+bB4fbx3qAwjJA8
h++bF6FFdigfbDKKnDtSMg4AqArKWqVobF+6qCAjfV0PvtRFjydqThPosKuSkQhO
a4+XHulAL0o0BsRrg0scn05ATV92MlVYZtb7dgTY5jH7v/cwh6PJTQZZKqtBB4HF
mwBfSRNxLijIUJuGIoIn3JBOWgISGPquu/ZApxqGcYp/owdDZWi4dmirXcN1GC8=
=zcMJ
-----END PGP SIGNATURE-----

--Sig_/hO.=B9pt+6R8i2_3TBkz90x--




Message sent to bug-guile@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#19459: #:export does not honor the merge-generics contract
Resent-From: Andy Wingo <wingo@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-guile@HIDDEN
Resent-Date: Mon, 27 Jun 2016 07:48:02 +0000
Resent-Message-ID: <handler.19459.B19459.146701363430353 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 19459
X-GNU-PR-Package: guile
X-GNU-PR-Keywords: 
To: David Pirotte <david@HIDDEN>
Cc: 19459 <at> debbugs.gnu.org
Received: via spool by 19459-submit <at> debbugs.gnu.org id=B19459.146701363430353
          (code B ref 19459); Mon, 27 Jun 2016 07:48:02 +0000
Received: (at 19459) by debbugs.gnu.org; 27 Jun 2016 07:47:14 +0000
Received: from localhost ([127.0.0.1]:57420 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bHRGE-0007tV-Bq
	for submit <at> debbugs.gnu.org; Mon, 27 Jun 2016 03:47:14 -0400
Received: from pb-sasl1.pobox.com ([64.147.108.66]:64867
 helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <wingo@HIDDEN>) id 1bHRGD-0007tO-3C
 for 19459 <at> debbugs.gnu.org; Mon, 27 Jun 2016 03:47:13 -0400
Received: from sasl.smtp.pobox.com (unknown [127.0.0.1])
 by pb-sasl1.pobox.com (Postfix) with ESMTP id C402B20300;
 Mon, 27 Jun 2016 03:47:09 -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=urwU8f3VLHI3m+KDePtBq9Fi/Uk=; b=F8buwM
 LY+Ga4XKyqyaCNcHHk4YCxW6qyqVPlJMstFGKlWZNSkuZ5gXcV/u6SVYvdacat6W
 lajn7K21iZnZ/bGlj44Nb1tDLrUXDxrnHyG+mn7b3tPARF2hequ1Y5y4LCxS87tK
 OQviWwK8ywAuVhltxh8bPRHRBLChMLunH9Vzo=
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=eR2cABn+lMDw0lGyVmpbuBAqKQMV2VN2
 +Bgq7GoO8HxPUSc43WLK5HGS8ChJbYgiwr4cQhCMoARX7UdosysFkqffNLoQgZAY
 nSSVk+MhyDq0wvKgCxIt35vycoqlxGx7vgEgn7CyqTeC58OzY0R9dPiHVBE/sypx
 AdXF+3Eoy44=
Received: from pb-sasl1.nyi.icgroup.com (unknown [127.0.0.1])
 by pb-sasl1.pobox.com (Postfix) with ESMTP id BC73C202FE;
 Mon, 27 Jun 2016 03:47:09 -0400 (EDT)
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 D4C6D202FC;
 Mon, 27 Jun 2016 03:47:08 -0400 (EDT)
From: Andy Wingo <wingo@HIDDEN>
References: <20141228162024.048ca208@capac> <87vb11q8ir.fsf@HIDDEN>
 <20160623162321.448e47af@capac> <87oa6rllfg.fsf@HIDDEN>
 <20160623181103.00e09d95@capac> <87twgjji1k.fsf@HIDDEN>
 <20160626235455.7726d721@capac>
Date: Mon, 27 Jun 2016 09:47:01 +0200
In-Reply-To: <20160626235455.7726d721@capac> (David Pirotte's message of "Sun, 
 26 Jun 2016 23:54:55 -0300")
Message-ID: <87d1n39iq2.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Pobox-Relay-ID: 59F5A60A-3C3B-11E6-B682-C1836462E9F6-02397024!pb-sasl1.pobox.com
X-Spam-Score: -1.0 (-)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On Mon 27 Jun 2016 04:54, David Pirotte <david@HIDDEN> writes:

> Hello Andy,
>
>> >> However... I believe merge-generics is intended to merge duplicate
>> >> imported bindings.  It does not provide a copy-on-write version of an
>> >> imported generic, if that generic was not duplicated in the imports.
>> >> There is no facility in GOOPS to do that, AFAIU.  
>
>> > It is a module bug, not a GOOPS bug, see my 'personal/local' fix: the problem is
>> > that once the user uses #:export, guile's module system create a new binding,
>> > and it should not ... [hence this confusion as well: as it is: the module must
>> > merge its definition with the imported ones, even if it imported only 1
>> > generic ... because of a module bug...]  
>
>> I... I just think you're wrong here, sorry :/ That's just not how the
>> system works.  If you #:export an identifier in a module, you create a
>> fresh local binding, and that binding doesn't implicitly extend an
>> imported binding, merge-generics or no.  Merge-generics only operates on
>> the import interface of a module.
>
> I don't think so, and I feel sorry too ;/. We disagree, which is different, and
> nobody is 'right' or 'wrong' here. [and I know 'how the system works, I described
> it that in the original email, I'd like to change that, hence this thread ...]
>
> IMO, this should never fail:
>
> 	,use (b)
> 	make <b>

There are plenty of reasons for (make foo) to fail in the abstract --
from bad logic in the initializers, to the initializer using unbound
variables, to many other things.  In this case your initializer is:

(define-method (initialize (self <b>) initargs)
  (next-method)  
  (let ((a (make <a>)))
    (set-width self (get-width a))
    #;(add-child b a)))

However in this module you have done an #:export get-width on B, and so
the get-width that you are calling in module (b) has no methods for
values of type A.

> Your last sentence states that merge-generics only operates on the import interface
> of a module: that is the feature I'm referring to to claim the above:
>
>   [ using #:export ]
>
> 	t0	the system creates new 'empty' binding
> 		at some point 'it' knows it is a gf
> 	ti	it imports (a)
>
> 	now the (b) module interface is facing a duplicate gf binding, and according
> 	to the user settings wrt to this, it has to merge.

I'm not sure from this whether you think the current code has a bug or a
feature limitation.

For me :) I have it clear in my mind that there does not appear to be a
bug here.  merge-generics only operates over bindings that are imported
in a module: module A imports modules B and C, and B and C both export a
generic `foo'.  Or one is a generic and one is not, or something like
that.  merge-generics *does not* merge an imported binding and a local
definition.

It does seem like you want the system to work in a different way, and
that position is understandable -- however designing and implementing
such a thing is very low on my priority list right now and I doubt I
will get to it any time soon if at all.  If you or someone else wants to
implement this, the first step would be to come up with a design
including a patch to the documentation and mail the list.  I think I
would want the design before seeing a patch.

Regards,

Andy





Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.