From: David Pirotte <david@altosw.be>
To: Andy Wingo <wingo@pobox.com>
Cc: guile-devel <guile-devel@gnu.org>
Subject: Re: goops - guile-clutter unexpected bug while using #:virtual slot allocation for a <clutter-actor> subclass
Date: Wed, 28 Jan 2015 01:36:05 -0200 [thread overview]
Message-ID: <20150128013605.5341bfae@capac> (raw)
In-Reply-To: <20150128010524.762e14a2@capac>
[-- Attachment #1: Type: text/plain, Size: 3897 bytes --]
Hi again,
and, to be very very precise, I even renamed my directory now [which appears in the
compilation trace] because its previous name was terrible (and terribly wrong)!
so, the appropriate directory name is: .../setter-inheritance-bug
[ the new trace is here below, 'in place'
[ the rest of the text is unchanged
[ and I still pretend it is a bug
Cheers,
David
> ...
> Oh no, it's not working as it should, too bad: this time I cleared my cache
> I did not take care of that carefully enough I guess... anyway, the good news is
> that:
>
> I think we still are not talking about _exactly_ the same think here and
> hope that when we do, you will agree;
>
> Indeed please note that in the code of my previous message, the define
> setter on the <b> class _is_ commented: i am sorry if it induced you in
> some sort of misunderstanding, but that line should _not_ even exist (that
> was a trick to circumvent till now);
>
> If that line does not exist, then using the setter on a <b> instance must
> call/execute the code of the setter defined at superclass level, <a> in our
> case. by no mean, it should internally/hiddenly redefine my beautiful
> setter :), in my back, not without talking to me first anyway :)
>
> So, here is the code, without the setter being redefined...:
>
> ;; module a.scm starts here
> (define-module (a)
> #:use-module (oop goops)
> #:export (<a>
> !width))
>
> (define-class <a> ()
> (width #:accessor !width #:init-keyword #:width #:init-value 0))
>
> (define-method ((setter !width) (self <a>) width)
> ;; here comes complex code, computing earth orbit and calling lower
> ;; level clutter internals, such as the <clutter-actor> layout...
> (pk "this is <a> !width setter method, hello!")
> (slot-set! self 'width width))
> ;; module ends here
>
> ;; module b.scm starts here
> (define-module (b)
> #:use-module (oop goops)
> #:use-module (a)
> #:export (<b>)
>
> #:re-export (!width))
>
> (define-class <b> (<a>))
> ;; module ends here
>
> And here is what I get, which is not correct: since I did not redefine anything
> at <b> level, the slot and 'associated functionality', the setter in this case,
> must be 'fully' inherited: it is the setter I define on <a> that must be called
> when being used on any instances, all <a> and <b> instances
>
> [ this time I left the guile version as well), please double check
david@capac:~/alto/projects/guile-tests/goops/setter-inheritance-bug 21 $ guile
GNU Guile 2.0.11.113-583a
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)> ,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=0
;;; 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)> (make <b>)
$1 = #<<b> 21b39a0>
scheme@(guile-user)> (!width $1)
$2 = 0
scheme@(guile-user)> (set! (!width $1) 20)
$3 = 20
scheme@(guile-user)>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
next prev parent reply other threads:[~2015-01-28 3:36 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-19 19:46 goops - guile-clutter unexpected bug while using #:virtual slot allocation for a <clutter-actor> subclass David Pirotte
2014-12-19 23:42 ` Panicz Maciej Godek
2014-12-20 6:16 ` David Pirotte
2015-01-26 21:35 ` Andy Wingo
2015-01-27 1:00 ` David Pirotte
2015-01-27 8:29 ` Andy Wingo
2015-01-27 19:11 ` David Pirotte
2015-01-27 19:35 ` David Pirotte
2015-01-27 20:44 ` Andy Wingo
2015-01-28 3:05 ` David Pirotte
2015-01-28 3:36 ` David Pirotte [this message]
2015-01-28 12:57 ` Andy Wingo
2015-01-28 19:24 ` David Pirotte
2015-01-30 13:50 ` David Pirotte
2015-02-06 13:33 ` Andy Wingo
2015-02-06 17:09 ` David Pirotte
2015-02-06 17:49 ` Andy Wingo
2015-02-07 0:06 ` David Pirotte
2015-02-07 15:37 ` Andy Wingo
2015-02-07 17:13 ` David Pirotte
2015-02-07 16:08 ` David Pirotte
2015-02-04 16:12 ` David Pirotte
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150128013605.5341bfae@capac \
--to=david@altosw.be \
--cc=guile-devel@gnu.org \
--cc=wingo@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).