GNU bug report logs - #20423
goops - inheritance of slot options

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guile; Reported by: David Pirotte <david@HIDDEN>; dated Sat, 25 Apr 2015 02:07:01 UTC; Maintainer for guile is bug-guile@HIDDEN.

Message received at 20423 <at> debbugs.gnu.org:


Received: (at 20423) by debbugs.gnu.org; 23 Jun 2016 23:09:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jun 23 19:09:20 2016
Received: from localhost ([127.0.0.1]:53118 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bGDkO-000323-Fa
	for submit <at> debbugs.gnu.org; Thu, 23 Jun 2016 19:09:20 -0400
Received: from maximusconfessor.all2all.org ([79.99.200.102]:58255)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <david@HIDDEN>) id 1bGDkM-00031u-DW
 for 20423 <at> debbugs.gnu.org; Thu, 23 Jun 2016 19:09:19 -0400
Received: from localhost (unknown [192.168.0.2])
 by maximusconfessor.all2all.org (Postfix) with ESMTP id 95D98A04C0E0;
 Fri, 24 Jun 2016 01:09:16 +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 IY0r8rrFyT5y; Fri, 24 Jun 2016 01:09:11 +0200 (CEST)
Received: from capac (unknown [179.210.35.216])
 by maximusconfessor.all2all.org (Postfix) with ESMTPSA id DB1EBA04C00F;
 Fri, 24 Jun 2016 01:09:10 +0200 (CEST)
Date: Thu, 23 Jun 2016 20:08:57 -0300
From: David Pirotte <david@HIDDEN>
To: Andy Wingo <wingo@HIDDEN>
Subject: Re: bug#20423: goops - inheritance of slot options
Message-ID: <20160623200857.1e0d3e51@capac>
In-Reply-To: <87inwzlkme.fsf@HIDDEN>
References: <20150424230538.67db3eaa@capac>
	<87inwzlkme.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_/t9T3.iBt1ARxg4B489x+ZLt"; protocol="application/pgp-signature"
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 20423
Cc: 20423 <at> debbugs.gnu.org
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_/t9T3.iBt1ARxg4B489x+ZLt
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

Hi Andy,

> For what it's worth this is a part of GOOPS's design AFAIU: all slot
> definitions are unique.  Two slots named S declared on classes A and B
> are distinct, even if A is a superclass of B.

Well, as I explained in the original report, the only specification we have=
 is CLOS:
Stklos, upon which Guile GOOPS is based, clearly state in its manual, among=
 the
first paragraphs, that it implements the CLOS protocol [a subset]: there is=
 no
'redesign' anywhere in Stlkos [it just lacks :before and :after methods AFA=
ICT].

AFAICT, there is no Guile 'official' document stating clearly, neither in t=
he
manual, that GOOPS authors decided to redesign this part of the protocol an=
d why...
is there?

It seems to me, in this rather unfortunate case, that you take for a 'desig=
n' or a
'redesign', what was actually a great implementation to start with, no doub=
t, but
which has these bugs, implementation bugs, not design decisions.

> I don't know if we can change this.  I guess maybe.  There would have to
> be a design though.  I guess fleshing out the `compute-slots' protocol
> from http://www.alu.org/mop/concepts.html#class-finalization-protocol
> would be the thing.

Not sure what you mean by 'we can't change this', but I hope/think it can b=
e fixed,
technically I don't see what could prevent this to be done since Stklos doe=
s the
right thing... [I'm pretty sure gauche does the right thing too, and in any=
 case,
all CLOS implementation do]. Maybe you are referring to some C part of the =
code I'm
not aware of that would effectively prevent a fix, don't know...

> I believe that technically you can already provide your own
> `compute-slots' implementation, but you are probably missing some
> definitions that would help you do so in a compatible manner.  Check it
> out for yourself and give it a go, no need to wait on Guile people :)

	Right: if you want it right do it yourself ... :)=20

It actually is my intention, it has been for years, to study, dig into and =
work on
our GOOPS implementation and start to help maintain it ... if I only had mo=
re time,
I would have done it already.

Till then we rely on you, And even though I could do it 'right now' we'd st=
ill have,
unless selfish my own implementation in my little corner, still have to agr=
ee upon
the design reference document(s) GOOPS has been/should be based  upon:

	and I want GOOPS to follow the CLOS protocol, for its entire subset, not j=
ust
	for me, but any Guilers, and especially the one that will learn oop using
	GOOPS;

	the above, especially for getters, setters, accessors inheritance _and_ th=
is
	bug, slot redefinition.

So, rather then being a technical problem, we strongly disagree, unfortunat=
ely, on
what GOOPS protocol should implement, don't you think it would be better to=
 follow
the CLOS protocol?

	Could you list what you consider a win, for humanity :), in blocking slot
	option redefinition and inheritance to be blocked?

	Could we talk to the original GOOPS author, and if so, would you be
	convinced, if he confirms of course, that all these are bugs and not design
	decisions?

All this said, I wonder, before I start :), if the still C part of the code=
 would
prevent me to patch GOOPS so it fully respect the CLOS protocol?

Thanks,
David

--Sig_/t9T3.iBt1ARxg4B489x+ZLt
Content-Type: application/pgp-signature
Content-Description: OpenPGP digital signature

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

iQEcBAEBCAAGBQJXbGwJAAoJEPN0/ZOjBXrXXOQIAJzkhlzPVRvkFbty7E8u7fcY
Sy7dnqKxpMJUPnxH478Sc5z68NbEi9tWS9QznSm8cskaIPGZaUMtxB7ovFpa0wUA
GRo4WCqQWvKF49glthu48VGC5DkPNkLZfbsCS70RqbE4APmTdD5w+wzHACcvVo6F
6sXqIVX6a3DikYRtNQl2D7BEwSgqF1Ig5xXQQFiO9PgQ1qJUbQqYG30wFybhMiA7
fs9r8Iuyja/2o22zFXqyCx4Wr1mZoTIp16epYF08kkdaOTTo5+Q6WVqhVl3FJ19U
Tu+7qaggcWc/bXLnPIYJT0/8ARQvGNROPZlzG1UMDufNVQVe0OwGPfSoe4H2BGQ=
=nCDC
-----END PGP SIGNATURE-----

--Sig_/t9T3.iBt1ARxg4B489x+ZLt--




Information forwarded to bug-guile@HIDDEN:
bug#20423; Package guile. Full text available.

Message received at 20423 <at> debbugs.gnu.org:


Received: (at 20423) by debbugs.gnu.org; 23 Jun 2016 20:24:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jun 23 16:24:09 2016
Received: from localhost ([127.0.0.1]:53025 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bGBAX-0005nI-5F
	for submit <at> debbugs.gnu.org; Thu, 23 Jun 2016 16:24:09 -0400
Received: from pb-sasl2.pobox.com ([64.147.108.67]:63080
 helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <wingo@HIDDEN>) id 1bGBAV-0005n9-Lr
 for 20423 <at> debbugs.gnu.org; Thu, 23 Jun 2016 16:24:08 -0400
Received: from sasl.smtp.pobox.com (unknown [127.0.0.1])
 by pb-sasl2.pobox.com (Postfix) with ESMTP id 6349C246CD;
 Thu, 23 Jun 2016 16:24:05 -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=flcVKktTwk+Ze12pM/OgANTyOVg=; b=U4+v+5
 SiLPtFXKUuk7md1A4ZenkNdj4q97yYUdCqY2cnUTTGu97OfFZRPIZSYat0j5P15F
 hJi+cID7sduCAZWw1deAlpG+6BeTjM1lg57NPE3R8jUa/kr++2UmCyqOEBXh7gQl
 TjYZXB2kH6T9bYQcL0J2BL+7c839mbhghZMOw=
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=iq/mUW+gKRpxWjGaDyay3ZPntMXX4CTt
 7/T0WTQZtq3bvUQG2+lLp2Wfpgr5zjFWtVjIybyy1UD0PGWaXix38e6ABumET837
 KHMFT5fyRsrMPQP/1EBM9TBJnzagRMMsCRV9KRJcFWZRVNJ4B9b+t0V0V801ksBQ
 9Huj11EFeGQ=
Received: from pb-sasl2.nyi.icgroup.com (unknown [127.0.0.1])
 by pb-sasl2.pobox.com (Postfix) with ESMTP id 5D06F246CC;
 Thu, 23 Jun 2016 16:24:05 -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 0FBD0246CB;
 Thu, 23 Jun 2016 16:24:03 -0400 (EDT)
From: Andy Wingo <wingo@HIDDEN>
To: David Pirotte <david@HIDDEN>
Subject: Re: bug#20423: goops - inheritance of slot options
References: <20150424230538.67db3eaa@capac>
Date: Thu, 23 Jun 2016 22:23:53 +0200
In-Reply-To: <20150424230538.67db3eaa@capac> (David Pirotte's message of "Fri, 
 24 Apr 2015 23:05:38 -0300")
Message-ID: <87inwzlkme.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: 6DE92CEE-3980-11E6-9604-28A6F1301B6D-02397024!pb-sasl2.pobox.com
X-Spam-Score: -1.4 (-)
X-Debbugs-Envelope-To: 20423
Cc: 20423 <at> debbugs.gnu.org
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,

For what it's worth this is a part of GOOPS's design AFAIU: all slot
definitions are unique.  Two slots named S declared on classes A and B
are distinct, even if A is a superclass of B.

I don't know if we can change this.  I guess maybe.  There would have to
be a design though.  I guess fleshing out the `compute-slots' protocol
from http://www.alu.org/mop/concepts.html#class-finalization-protocol
would be the thing.

I believe that technically you can already provide your own
`compute-slots' implementation, but you are probably missing some
definitions that would help you do so in a compatible manner.  Check it
out for yourself and give it a go, no need to wait on Guile people :)

Andy

On Sat 25 Apr 2015 04:05, David Pirotte <david@HIDDEN> writes:

> Hello,
>
> 	GNU Guile 2.0.11.114-649ec
> 	goops - inheritance of slot options
> 	severity - serious
>
> The current goops implementation breaks the [clos] protocol [*] for inheritance of
> slot options.  This is a serious bug.
>
> Below, [A] what stklos does, [B] what goops does, [*] a summary of what the clos
> protocol says wrt  inheritance of slot options.
>
> Cheers,
> David
>
>
> [A]	Here is what stklos does:
>
> 	stklos/subclass-slot-redefinition.scm
>
> (define-class <person> ()
>   ((name :accessor name :init-keyword :name :init-form "")
>    (age :accessor age :init-keyword :age :init-form -1)))
>
> (define-class <teacher> (<person>)
>   ((subject :accessor subject :init-keyword :subject :init-form "")))
>
> (define-class <maths-teacher> (<teacher>)
>   ((subject :init-form "Mathematics")))
>
> david@capac:~/alto/projects/stklos 15 $ stklos
> *   STklos version 1.10
>  *  Copyright (C) 1999-2011 Erick Gallesio - Universite de Nice <eg@HIDDEN>
> * * [Linux-3.16.0-4-amd64-x86_64/pthread/readline/utf8]
> stklos> (load "subclass-slot-redefinition.scm")
> stklos> (define p2 (make <maths-teacher> :name 'john :age 34))
> ;; p2
> stklos> (describe p2)
> #[<maths-teacher> 28a2420] is an an instance of class <maths-teacher>.
> Slots are: 
>      age = 34
>      name = john
>      subject = "Mathematics"
> stklos> (subject p2)
> "Mathematics"
> stklos> 
>
>
> [B]	Here is what goops does:
>
> 	goops/subclass-slot-redefinition.scm
>
> (use-modules (oop goops))
>
> (define-class <person> ()
>   (name #:accessor name #:init-keyword #:name #:init-form "")
>   (age #:accessor age #:init-keyword #:age #:init-form -1))
>
> (define-class <teacher> (<person>)
>   (subject #:accessor subject #:init-keyword #:subject #:init-form ""))
>
> (define-class <maths-teacher> (<teacher>)
>   (subject #:init-form "Mathematics"))
>
> david@capac:~/alto/projects/guile-tests/goops 51 $ guile
> GNU Guile 2.0.11.114-649ec
> Copyright (C) 1995-2014 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)> (load "subclass-slot-redefinition.scm")
> ;;; 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/goops/subclass-slot-redefinition.scm
> ;;;
> compiled /home/david/.cache/guile/ccache/2.0-LE-8-2.0/usr/alto/projects/guile-tests/goops/subclass-slot-redefinition.scm.go
> scheme@(guile-user)> (define p2 (make <maths-teacher> #:name 'john #:age 34))
> scheme@(guile-user)> ,use (oop goops describe) scheme@(guile-user)> (describe p2)
> #<<maths-teacher> 1432300> is an instance of class <maths-teacher>
> Slots are: 
>      name = john
>      age = 34
>      subject = "Mathematics"
> scheme@(guile-user)> (subject p2)
> ERROR: In procedure scm-error:
> ERROR: No applicable method for #<<accessor> subject (1)> in call (subject
> #<<maths-teacher> 1432300>)
>
> Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.
> scheme@(guile-user) [1]> 
>
>
> [*] A summary of what the clos protocol says:
>
> 	[ this is a copy/paste from a clos tutorial, also pointed by
> 	[ the Stklos reference manual:
>
> 	[	http://www.aiai.ed.ac.uk/~jeff/clos-guide.html#slots
>
> 	When there are superclasses, a subclass can specify a slot that has already
> 	been specified for a superclass. When this happens, the information in slot
> 	options has to be combined. For the slot options listed above, either the
> 	option in the subclass overrides the one in the superclass or there is a
> 	union:
>
> 	   :ACCESSOR  -  union
> 	   :INITARG   -  union
> 	   :INITFORM  -  overrides
>
> 	This is what you should expect. The subclass can change the default initial
> 	value by overriding the :initform, and can add to the initargs and accessors.
>
> 	However, the union for :accessor is just a consequence of how generic
> 	functions work. If they can apply to instances of a class C, they can also
> 	apply to instances of subclasses of C. (Accessor functions are generic.)




Information forwarded to bug-guile@HIDDEN:
bug#20423; Package guile. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 25 Apr 2015 02:06:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 24 22:06:31 2015
Received: from localhost ([127.0.0.1]:39095 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1YlpUE-0008Il-MS
	for submit <at> debbugs.gnu.org; Fri, 24 Apr 2015 22:06:31 -0400
Received: from eggs.gnu.org ([208.118.235.92]:38070)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <david@HIDDEN>) id 1YlpUD-0008IY-1E
 for submit <at> debbugs.gnu.org; Fri, 24 Apr 2015 22:06:29 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <david@HIDDEN>) id 1YlpU6-0004Qj-AB
 for submit <at> debbugs.gnu.org; Fri, 24 Apr 2015 22:06:23 -0400
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,
 T_FILL_THIS_FORM_SHORT autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:46612)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <david@HIDDEN>) id 1YlpU6-0004Qa-7a
 for submit <at> debbugs.gnu.org; Fri, 24 Apr 2015 22:06:22 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:51572)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <david@HIDDEN>) id 1YlpU4-0001n2-H4
 for bug-guile@HIDDEN; Fri, 24 Apr 2015 22:06:22 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <david@HIDDEN>) id 1YlpTv-0004Oy-F2
 for bug-guile@HIDDEN; Fri, 24 Apr 2015 22:06:20 -0400
Received: from maximusconfessor.all2all.org ([79.99.200.102]:40055)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <david@HIDDEN>) id 1YlpTv-0004NJ-71
 for bug-guile@HIDDEN; Fri, 24 Apr 2015 22:06:11 -0400
Received: from localhost (unknown [192.168.0.2])
 by maximusconfessor.all2all.org (Postfix) with ESMTP id 49B77A04C173
 for <bug-guile@HIDDEN>; Sat, 25 Apr 2015 04:05:49 +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 6QplZDNyBToj for <bug-guile@HIDDEN>;
 Sat, 25 Apr 2015 04:05:42 +0200 (CEST)
Received: from capac (unknown [179.210.41.179])
 by maximusconfessor.all2all.org (Postfix) with ESMTPSA id A7E9EA04C0EF
 for <bug-guile@HIDDEN>; Sat, 25 Apr 2015 04:05:41 +0200 (CEST)
Date: Fri, 24 Apr 2015 23:05:38 -0300
From: David Pirotte <david@HIDDEN>
To: <bug-guile@HIDDEN>
Subject: goops - inheritance of slot options
Message-ID: <20150424230538.67db3eaa@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-sha256;
 boundary="Sig_/lxcRwVD_+dtKi_IpLWz6/YA"; 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-Debbugs-Envelope-To: submit
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_/lxcRwVD_+dtKi_IpLWz6/YA
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

Hello,

	GNU Guile 2.0.11.114-649ec
	goops - inheritance of slot options
	severity - serious

The current goops implementation breaks the [clos] protocol [*] for inherit=
ance of
slot options.  This is a serious bug.

Below, [A] what stklos does, [B] what goops does, [*] a summary of what the=
 clos
protocol says wrt  inheritance of slot options.

Cheers,
David


[A]	Here is what stklos does:

	stklos/subclass-slot-redefinition.scm

--8<---------------cut here---------------start------------->8---
(define-class <person> ()
  ((name :accessor name :init-keyword :name :init-form "")
   (age :accessor age :init-keyword :age :init-form -1)))

(define-class <teacher> (<person>)
  ((subject :accessor subject :init-keyword :subject :init-form "")))

(define-class <maths-teacher> (<teacher>)
  ((subject :init-form "Mathematics")))
--8<---------------cut here---------------end-------------->8---

david@capac:~/alto/projects/stklos 15 $ stklos
*   STklos version 1.10
 *  Copyright (C) 1999-2011 Erick Gallesio - Universite de Nice <eg@HIDDEN=
r>
* * [Linux-3.16.0-4-amd64-x86_64/pthread/readline/utf8]
stklos> (load "subclass-slot-redefinition.scm")
stklos> (define p2 (make <maths-teacher> :name 'john :age 34))
;; p2
stklos> (describe p2)
#[<maths-teacher> 28a2420] is an an instance of class <maths-teacher>.
Slots are:=20
     age =3D 34
     name =3D john
     subject =3D "Mathematics"
stklos> (subject p2)
"Mathematics"
stklos>=20


[B]	Here is what goops does:

	goops/subclass-slot-redefinition.scm

--8<---------------cut here---------------start------------->8---
(use-modules (oop goops))

(define-class <person> ()
  (name #:accessor name #:init-keyword #:name #:init-form "")
  (age #:accessor age #:init-keyword #:age #:init-form -1))

(define-class <teacher> (<person>)
  (subject #:accessor subject #:init-keyword #:subject #:init-form ""))

(define-class <maths-teacher> (<teacher>)
  (subject #:init-form "Mathematics"))
--8<---------------cut here---------------end-------------->8---

david@capac:~/alto/projects/guile-tests/goops 51 $ guile
GNU Guile 2.0.11.114-649ec
Copyright (C) 1995-2014 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)> (load "subclass-slot-redefinition.scm")
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=3D0
;;;       or pass the --no-auto-compile argument to disable.
;;; compiling /usr/alto/projects/guile-tests/goops/subclass-slot-redefiniti=
on.scm
;;;
compiled /home/david/.cache/guile/ccache/2.0-LE-8-2.0/usr/alto/projects/gui=
le-tests/goops/subclass-slot-redefinition.scm.go
scheme@(guile-user)> (define p2 (make <maths-teacher> #:name 'john #:age 34=
))
scheme@(guile-user)> ,use (oop goops describe) scheme@(guile-user)> (descri=
be p2)
#<<maths-teacher> 1432300> is an instance of class <maths-teacher>
Slots are:=20
     name =3D john
     age =3D 34
     subject =3D "Mathematics"
scheme@(guile-user)> (subject p2)
ERROR: In procedure scm-error:
ERROR: No applicable method for #<<accessor> subject (1)> in call (subject
#<<maths-teacher> 1432300>)

Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.
scheme@(guile-user) [1]>=20


[*] A summary of what the clos protocol says:

	[ this is a copy/paste from a clos tutorial, also pointed by
	[ the Stklos reference manual:

	[	http://www.aiai.ed.ac.uk/~jeff/clos-guide.html#slots

	When there are superclasses, a subclass can specify a slot that has already
	been specified for a superclass. When this happens, the information in slot
	options has to be combined. For the slot options listed above, either the
	option in the subclass overrides the one in the superclass or there is a
	union:

	   :ACCESSOR  -  union
	   :INITARG   -  union
	   :INITFORM  -  overrides

	This is what you should expect. The subclass can change the default initial
	value by overriding the :initform, and can add to the initargs and accesso=
rs.

	However, the union for :accessor is just a consequence of how generic
	functions work. If they can apply to instances of a class C, they can also
	apply to instances of subclasses of C. (Accessor functions are generic.)

--Sig_/lxcRwVD_+dtKi_IpLWz6/YA
Content-Type: application/pgp-signature
Content-Description: OpenPGP digital signature

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

iQEcBAEBCAAGBQJVOvZyAAoJEPN0/ZOjBXrXe/EIAKl/G54SyQNgWSC2ClE0nTvK
W/IONbSCKicD1aqKlXsBuvQCHF4YGpyxlfBO0Dg9buR/THcY70Tii5mYQjo1C6IT
VFEirJDoZjxpR9Nu+4fdaY8NF4eEYMiC6dWA23gWr5MyhoxM86tHu70F0Q7PRI0K
4HGklopZD68wPw0G5yFGtaNe4h+hY8I/H5TBBk7O3ZD44TUwrwm4krp8b6+ZYsqk
EzRPegu8csbLUAgxwsRoF2VEYASPWriMvabBFajCk8kqJ+EvgD9GxEl4pgXsdQfH
4CeLhCz2vmne1pneAXIFV3Phz8QsMPxuxIGwyTDZ3TPZbdRim+RvAJwX5HRm0ck=
=CF3n
-----END PGP SIGNATURE-----

--Sig_/lxcRwVD_+dtKi_IpLWz6/YA--




Acknowledgement sent to David Pirotte <david@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-guile@HIDDEN. Full text available.
Report forwarded to bug-guile@HIDDEN:
bug#20423; Package guile. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 23 Jun 2016 23:15:01 UTC

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