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: Wed, 4 Feb 2015 14:12:54 -0200 Message-ID: <20150204141254.44d1bf85@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_/7QaA3/spzNNvjyIb2wqBIdA"; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1423066463 3077 80.91.229.3 (4 Feb 2015 16:14:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 4 Feb 2015 16:14:23 +0000 (UTC) Cc: guile-devel To: Andy Wingo Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Wed Feb 04 17:14:22 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 1YJ2as-0005ZN-Eq for guile-devel@m.gmane.org; Wed, 04 Feb 2015 17:14:22 +0100 Original-Received: from localhost ([::1]:37186 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJ2ar-0005bJ-Rp for guile-devel@m.gmane.org; Wed, 04 Feb 2015 11:14:21 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53111) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJ2Zl-00048f-5S for guile-devel@gnu.org; Wed, 04 Feb 2015 11:13:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YJ2Zd-00074f-NF for guile-devel@gnu.org; Wed, 04 Feb 2015 11:13:13 -0500 Original-Received: from maximusconfessor.all2all.org ([79.99.200.102]:45844) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJ2Zd-00074F-Fe for guile-devel@gnu.org; Wed, 04 Feb 2015 11:13:05 -0500 Original-Received: from localhost (unknown [192.168.0.2]) by maximusconfessor.all2all.org (Postfix) with ESMTP id 354D3A04C16E; Wed, 4 Feb 2015 17:13:04 +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 XKsFrEwSvTZz; Wed, 4 Feb 2015 17:12:57 +0100 (CET) Original-Received: from capac (unknown [179.210.33.24]) by maximusconfessor.all2all.org (Postfix) with ESMTPSA id 926EFA04C164; Wed, 4 Feb 2015 17:12:56 +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:17649 Archived-At: --Sig_/7QaA3/spzNNvjyIb2wqBIdA Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hello Andy, > $ /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) With respect to the above example(*), I _do_ get the expected result here, = using the latest stable-2.0: please leave it as it is, it _is_ correct: I'm writing back because you pretend it should not work, I got confused... but it does, as it should, thanks god, the opposite would be a real disast= er Cheers, David (*) not to be confused with the setter inheritance bug I mentioned, still is present in the latest stable, so I [just[ reported it. --8<---------------cut here---------------start------------->8--- (define-module (a) #:use-module (oop goops) #:export ( !width)) (define-class () (width #:accessor !width #:init-keyword #:width #:init-value 0)) (define-method ((setter !width) (self ) width) ;; here comes complex code, computing earth orbit, captain's age... (pk "this is !width setter method, hello!") (slot-set! self 'width width)) --8<---------------cut here---------------start------------->8--- --8<---------------cut here---------------start------------->8--- (define-module (b) #:use-module (oop goops) #:use-module (a) #:export () #:re-export (!width)) (define-class ()) (define-method ((setter !width) (self ) width) (next-method) ;; here comes 'extra' work instances must 'run' (pk "this is !width setter method, hello!") (!width self)) --8<---------------cut here---------------start------------->8--- 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)>=20 scheme@(guile-user)>=20 scheme@(guile-user)> ,use (oop goops) 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/setter-inheritance-bug/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 ;;; note: source file ./a.scm ;;; newer than compiled /home/david/.cache/guile/ccache/2.0-LE-8-2.0/= usr/alto/projects/guile-tests/goops/setter-inheritance-bug/a.scm.go ;;; compiling ./a.scm ;;; compiled /home/david/.cache/guile/ccache/2.0-LE-8-2.0/usr/alto/projects= /guile-tests/goops/setter-inheritance-bug/a.scm.go ;;; compiled /home/david/.cache/guile/ccache/2.0-LE-8-2.0/usr/alto/projects= /guile-tests/goops/setter-inheritance-bug/b.scm.go scheme@(guile-user)> (set! (!width (make )) 20) ;;; ("this is !width setter method, hello!") ;;; ("this is !width setter method, hello!") $2 =3D 20 scheme@(guile-user)>=20 --Sig_/7QaA3/spzNNvjyIb2wqBIdA Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJU0kUGAAoJEPN0/ZOjBXrXX28H+wflzQafQcozzU2Bbq7WV1pR 1mxzEih+bHY611fz4wJpPNeDdwQwcf+cu8CQoKKL995vYsV6aLiTvj/M42DE9Ofx 0sgq7V5BcnbfVt0BGKzfWckXXisAwdI4y44JsAdwUGpL4yhm10Fbiz+1LoctXtX0 qRnl+np+vkhgR9hzo7BTQncgIKQUTlE74FF8EOOUsjbQqPS7rQxUU9PhwJTv+m7N LdrM27s137ZKzYIE60KCbNkc6uHnLV0oTSBfXdR4QT9X2PoVKNQQO2oA6EAlnJZm H5Wsc1KTLWDLXlWF1g6tkReD7Gn3uGxsArWwtc0UivdnhOouWIlw9Dyq3sZiuJE= =UPep -----END PGP SIGNATURE----- --Sig_/7QaA3/spzNNvjyIb2wqBIdA--