From: David Pirotte <david@altosw.be>
To: Daniel Hartwig <mandyke@gmail.com>
Cc: guile-devel@gnu.org
Subject: Re: goops - accessors, methods and generics
Date: Fri, 22 Feb 2013 20:11:10 -0300 [thread overview]
Message-ID: <20130222201110.0a9e715c@capac> (raw)
In-Reply-To: <CAN3veRdBaNZBaGVfUcahCB56bNP7+g5qF32FNMXNcS_yX8rs8A@mail.gmail.com>
Hi Daniel,
thanks for your answer, but where i understand a strict name space will lead to
merging the generic(s) from/with the ones that comes from the modules you are
importing [as opposed to a general 'goops' name space], i disagree that this would be
a 'pre limitation' that provides a proper handling of the problem we are talking
about.
> Note that <generic> is a superclass of <accessor>, so these are
> already generic functions.
great, so the interface is defined, right?
> Consider these situations followed by introducing any of your example
> class definitions:
> - module A binds ‘define’ to a non-procedure; or
> - modules B and C bind ‘define’ to different procedures.
let's stick to goops, shall we
> In your example the two classes share a common interface, but this
> interface is never defined anywhere.
you just said above that it is, at least for accessors: i am also defending the idea
that it should always automatically create a generic function [for methods as well]
if none exists.
> So if I have code that wants to work with any widget, which module should be
> imported to get the canonical interface definition?
the canonical definition comes from the first imported module that [also] defines
the generic: this is what occurs in the mg-3.scm example, and that actually works
fine, as you know.
however in the mg-4 example, it does not, which i think is an implementation
problem: since i am asking guile to merge... it should import mg-1 and merge its own
generics with the imported ones. there is no reason, and certainly not the name
space conservativness, why this is not properly implemented in guile.
> If the interface is the same, you have a candidate for superclass.
yes, that is a possibility, and in some cases i agree that it is the way to go, but
it should not be imposed on the user.
Cheers,
David
next prev parent reply other threads:[~2013-02-22 23:11 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-21 22:51 goops - accessors, methods and generics David Pirotte
2013-02-22 1:16 ` Daniel Hartwig
2013-02-22 23:11 ` David Pirotte [this message]
2013-02-23 0:37 ` Daniel Hartwig
2013-03-05 23:30 ` David Pirotte
2013-03-06 0:28 ` Mark H Weaver
2013-03-06 14:15 ` Ludovic Courtès
2013-02-23 11:20 ` Stefan Israelsson Tampe
2013-02-23 11:44 ` Stefan Israelsson Tampe
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=20130222201110.0a9e715c@capac \
--to=david@altosw.be \
--cc=guile-devel@gnu.org \
--cc=mandyke@gmail.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).