From: Andy Wingo <wingo@pobox.com>
To: David Pirotte <david@altosw.be>
Cc: guile-devel <guile-devel@gnu.org>
Subject: Re: Guile-2.2 - goops setters should be inherited, no matter what :)
Date: Tue, 14 Mar 2017 13:23:31 +0100 [thread overview]
Message-ID: <87zigo6o8s.fsf@pobox.com> (raw)
In-Reply-To: <20170226195558.764caaa5@capac> (David Pirotte's message of "Sun, 26 Feb 2017 19:57:17 -0300")
Hi,
On Sun 26 Feb 2017 23:57, David Pirotte <david@altosw.be> writes:
> 1- setters, as in (define-method ((setter ...) (self <...>) ...) ...)
> should (also :)) be inherited,
As you mention this is https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19770.
I think we have an understanding about why things are the way they are
in GOOPS, and you are arguing that they should be different -- different
from 1.8 and 2.0. That's OK and making a different system is possible
if we have good reasons. It's also possible to extend the current
system to implement new behaviors.
In this case though I don't know how to make a consistent system with
the semantics you are looking for and without losing some of the speed
of the current system. I guess you would want for the class defining
the slot to define a method that just does (slot-set! obj 'slot x), and
not have concrete subclasses define their own accessor methods, thereby
avoiding accessors entirely. In that case I would think you could
define slots with a different kind of class, or override the slot
definition protocol or something, or use a different define-class
wrapper or something.
In short I think I just don't agree with this change as part of standard
GOOPS, so I propose the second solution: to make sure you can implement
the behavior you want as a user. What about using a wrapper
define-class macro that removes "#:accessor foo" from its slot
definitions and translates those to issue definitions like this:
(define-method (foo (x <obj>)) (slot-ref x 'foo))
(define-method ((setter foo) (x <obj>) val) (slot-set! x 'foo val))
Andy
next prev parent reply other threads:[~2017-03-14 12:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-26 22:57 Guile-2.2 - goops setters should be inherited, no matter what :) David Pirotte
2017-02-28 19:48 ` Christopher Allan Webber
2017-02-28 20:42 ` David Pirotte
2017-03-14 12:23 ` Andy Wingo [this message]
2017-03-17 8:46 ` David Pirotte
2017-03-17 9:37 ` 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=87zigo6o8s.fsf@pobox.com \
--to=wingo@pobox.com \
--cc=david@altosw.be \
--cc=guile-devel@gnu.org \
/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).