From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: goops - guile-clutter unexpected bug while using #:virtual slot allocation for a subclass Date: Tue, 27 Jan 2015 09:29:23 +0100 Message-ID: <87sieweie4.fsf@pobox.com> References: <20141219174633.6efb845e@capac> <8761btfcni.fsf@pobox.com> <20150126230044.2d1e71de@capac> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1422347384 2851 80.91.229.3 (27 Jan 2015 08:29:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 27 Jan 2015 08:29:44 +0000 (UTC) Cc: guile-devel To: David Pirotte Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Jan 27 09:29:44 2015 Return-path: Envelope-to: guile-devel@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 1YG1Wm-0006Au-SN for guile-devel@m.gmane.org; Tue, 27 Jan 2015 09:29:41 +0100 Original-Received: from localhost ([::1]:45819 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YG1Wm-0004hL-78 for guile-devel@m.gmane.org; Tue, 27 Jan 2015 03:29:40 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33064) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YG1We-0004b8-Jg for guile-devel@gnu.org; Tue, 27 Jan 2015 03:29:37 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YG1Wa-0004Jw-1U for guile-devel@gnu.org; Tue, 27 Jan 2015 03:29:32 -0500 Original-Received: from pb-sasl1.int.icgroup.com ([208.72.237.25]:54413 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YG1WZ-0004Ix-Sj for guile-devel@gnu.org; Tue, 27 Jan 2015 03:29:27 -0500 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id 346E333CBE; Tue, 27 Jan 2015 03:29:27 -0500 (EST) 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=GhLZuIN7useVN3aUYjZjsD3Stoc=; b=QiRtmr kl9ohUTAvyVAMRVyfToUBj6sZ1pgEpFW4L24h03JEcITq0TxOtulylFfLWUQ/2cT 2tuiShPtN42KjdII8GQE+Ujkypu1hmc9322AVxJL4HjT3wJ6/b5bOmmEs6IobqqA GBzv8kmY5YYqVF3quzv7kUXWWFMWs/7tXnkuA= 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=dhThMp5V+uO5rhTVQzhdggXfTV/lyWIY UEUGDmViYyD5RkHi5hFzRPFVBELZ/8izZS5T4SPsXA34p0GZ9pUE0ezkYKS1vJOc yp/hSTemH8N9NlQx7Gi8i97uHdmzRVQVSQd7jTWHSTs1H23hnRUBqyHRBaaTq6G1 Q3dY6MJAMFQ= Original-Received: from pb-sasl1.int.icgroup.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id 29F4D33CBD; Tue, 27 Jan 2015 03:29:27 -0500 (EST) Original-Received: from badger (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 6BE9B33CBC; Tue, 27 Jan 2015 03:29:26 -0500 (EST) In-Reply-To: <20150126230044.2d1e71de@capac> (David Pirotte's message of "Mon, 26 Jan 2015 23:00:44 -0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) X-Pobox-Relay-ID: 9AD6EE10-A5FE-11E4-B745-B05EFC961345-02397024!pb-sasl1.pobox.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.72.237.25 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:17639 Archived-At: On Tue 27 Jan 2015 02:00, David Pirotte writes: >> Can you make a test case without guile-gnome? > > No, it is a guile-gnome problem/bug, so here below, a very short test case (*) OK, then please file it in the guile-gnome bugzilla. Thanks. We probably don't need to talk about it on guile-devel. > (*) I agree with you that this is less important then goops bugs of course, and I > would be particularly interested to get the setters inheritance bug solved before > anything else [if not done already as I write this answer :)]. Beside I found a way > to circumvent this problem, not perfect but ok, so no rush for this one. The setters inheritance bug is fixed to be like 1.8. I'll write another mail, but briefly the idea is this: an accessor on a slot (or a getter, or a setter), declared via #:accessor or #:getter or #:setter, is used to access the value of the slot in which it is declared. However not all subclasses of a class have all slots of their superclasses; consider: (define-class () (a #:accessor access-a)) (define-class () (a)) declares a *new* slot that happens to also have the same name, `a'. But all slots in any particular class have to have different names, so there's a procedure that builds the composite list of slots for any given class in the hierarchy, taking as input the class precedence list and the direct slots of all classes in that list. It prefers slots declared in more specific classes, so will have its own slot `a' *and not* the slot from . So for that reason, the accessor `access-a' *does not apply* to instances of . Applicability of accessor methods is based on whether the given class has the given slot, not based simply on the CPL. Now, I broke this in 2009, so it has been broken for all of Guile 2.0. I fixed it yesterday though, as it's in keeping with 1.8, and it was just wrong. OK. So what about your case? Well it's this: if you do this: (define-method (access-a (obj )) (next-method)) There is no next method, because the access-a accessor method from doesn't apply to , so you will get a no-applicable-method error. If you want to have generics that "inherit" accessors you'll have to come up with some other pattern. Andy -- http://wingolog.org/