From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Pirotte Newsgroups: gmane.lisp.guile.devel Subject: Re: goops - guile-clutter unexpected bug while using #:virtual slot allocation for a subclass Date: Fri, 30 Jan 2015 11:50:15 -0200 Message-ID: <20150130115015.5c8e3192@capac> References: <20141219174633.6efb845e@capac> <8761btfcni.fsf@pobox.com> <20150126230044.2d1e71de@capac> <87sieweie4.fsf@pobox.com> <20150127171115.6172ccea@capac> <87zj94c5rv.fsf@pobox.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_//Y5PmCZEbHe_8tBjXc/w+t="; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1422625874 27909 80.91.229.3 (30 Jan 2015 13:51:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 30 Jan 2015 13:51:14 +0000 (UTC) Cc: guile-devel To: Andy Wingo Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Jan 30 14:51:07 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 1YHByQ-0006vb-2N for guile-devel@m.gmane.org; Fri, 30 Jan 2015 14:51:02 +0100 Original-Received: from localhost ([::1]:36839 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YHByO-0003q0-Vv for guile-devel@m.gmane.org; Fri, 30 Jan 2015 08:51:00 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36772) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YHByL-0003pv-Ke for guile-devel@gnu.org; Fri, 30 Jan 2015 08:50:58 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YHByH-00063W-JP for guile-devel@gnu.org; Fri, 30 Jan 2015 08:50:57 -0500 Original-Received: from maximusconfessor.all2all.org ([79.99.200.102]:57673) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YHByH-00061P-AC for guile-devel@gnu.org; Fri, 30 Jan 2015 08:50:53 -0500 Original-Received: from localhost (unknown [192.168.0.2]) by maximusconfessor.all2all.org (Postfix) with ESMTP id 51DC3A04C156; Fri, 30 Jan 2015 14:50:31 +0100 (CET) Original-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 1DormCf7d3Pa; Fri, 30 Jan 2015 14:50:20 +0100 (CET) Original-Received: from capac (unknown [179.210.36.201]) by maximusconfessor.all2all.org (Postfix) with ESMTPSA id 5DE39A04C154; Fri, 30 Jan 2015 14:50:18 +0100 (CET) In-Reply-To: <87zj94c5rv.fsf@pobox.com> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 79.99.200.102 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:17647 Archived-At: --Sig_//Y5PmCZEbHe_8tBjXc/w+t= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Andy, > Are you certain? What git revision are you using? I don't think the > test should "work" with the current stable-2.0 or master, or 1.8 for > that matter. > $ /opt/guile-1.8/bin/guile > guile> (use-modules (oop goops)) > guile> (define-class () > ... (width #:accessor width #:init-keyword #:width #:init-value 0)) > guile> (define-class ()) > guile> (define b (make )) > guile> (width b) > 0 > guile> (set! (width b) 10) > guile> (width b) > 10 > guile> (define-method ((setter width) (self ) width) (next-method)) > guile> (set! (width b) 10) >=20 > Backtrace: > In current input: > 10: 0* [setter:width #< 7f795ed527e0> 10] > ?: 1 (let* ((next-method (goops:make-next-method self width))) > (next-method)) >=20 > : In expression (let* (#) (next-method)): > : No next method when calling #< setter:width = (2)> > with arguments (#< 7f795ed527e0> 10) > ABORT: (goops-error) When talking about goops, we should not refer to 1.8 (*), 1.6 or any guile = version for that matter, but to the clos language spec subset goops implements [app= art from the adaptation for it to be module protected, but that is not the point her= e]. This said and with that in mind, the implementation you say was in guile-1.= 8 and that it appears you have reimplemented 'right now' breaks the specification= and afaiac makes goops totally unusable for any serious work: this is a catastr= ophy, please reconsider! -] anything defined by a user using define-method _must_ pass thought the exact same computation machinery _and_ all become applicable methods; -] within the core of a define-method, one must always be able to call (next-method) [of course if the user do so inappropriately it raises an error, I'm not talking about that]; -] they is no exception for setters, which are _just_ methods, with, in addition and as we know, a bit of 'magic' so that they can be used with se= t! =09 -> otherwise, there would be 2 define-method semantics -> that can't be, and if it was the case the clos 'comity' would have defined another method for setters such as define-setter-method, and restrict that method from being able to call (call-next-method); -] within the core of methods, including the ones called with (next-method) calls to slot-ref slot-set! must _always_ call the instance(s) slot-ref- slot-set! as defined by the system [if none were provided], or the user's code they were provided [such as when #:allocation is #:virtual] We should not need any really, but here is a description [no code, no need = to at this point] of a [still very simple] 'visual' example, so everyone can foll= ow: let's define a gravity sensitive class and a !gravity setter, which sets the position of the instance on a scene and takes care of its layout [as in 'horizontal or 'vertical] depending on the gravity poles the instan= ce respond to: at some point this setter method calls sot-set! to set the instance position slot value, such as 'north-west; then we define a class, which inherit from , with an item slot filled with