From: "Pascal J. Bourguignon" <pjb@informatimago.com>
To: help-gnu-emacs@gnu.org
Subject: Re: EIEIO built in methods -- question
Date: Fri, 14 Jun 2013 20:29:01 +0200 [thread overview]
Message-ID: <878v2ch7gy.fsf@kuiper.lan.informatimago.com> (raw)
In-Reply-To: mailman.1680.1371226519.22516.help-gnu-emacs@gnu.org
Eric Abrahamsen <eric@ericabrahamsen.net> writes:
> David Engster <deng@randomsample.de> writes:
>
>> Eric Abrahamsen writes:
>>> There's the eieio-singleton class provided as part of the package, which
>>> does the same thing in principle: only lets you create one instance of
>>> the class.
>>
>> [...]
>>
>>> This is the same idea, yes?
>>
>> Yes. You can simply put eieio-singleton in your list of superclasses and
>> you will inherit this behavior.
>>
>>> I don't know why "name" and "slots" aren't passed to
>>> `call-next-method'.
>>
>> That's done by default. You only provide arguments to `call-next-method'
>> if you'd like to override them.
>
> Thanks! That's helps quite a bit.
Notice that in CLOS, you are forbidden to provide new arguments that
would change the chain of methods that will be called:
"When providing arguments to call-next-method, the following rule
must be satisfied or an error of type error should be signaled: the
ordered set of applicable methods for a changed set of arguments for
call-next-method must be the same as the ordered set of applicable
methods for the original arguments to the generic
function. Optimizations of the error checking are possible, but they
must not change the semantics of call-next-method."
Since CLOS can dispatch on all the mandatory parameters, it's a strong
constraint.
Now, in the case of eieio, it can only dispatch on the first argument,
so as long as you keep it, or an instance of the same class, you should
be able to do as you wish.
--
__Pascal Bourguignon__ http://www.informatimago.com/
A bad day in () is better than a good day in {}.
You can take the lisper out of the lisp job, but you can't take the lisp out
of the lisper (; -- antifuchs
next prev parent reply other threads:[~2013-06-14 18:29 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-09 10:22 EIEIO built in methods -- question Eric Abrahamsen
2013-06-09 10:49 ` Eric Abrahamsen
2013-06-09 11:54 ` Pascal J. Bourguignon
2013-06-09 15:22 ` Eric Abrahamsen
[not found] ` <mailman.1279.1370791373.22516.help-gnu-emacs@gnu.org>
2013-06-09 20:47 ` Pascal J. Bourguignon
2013-06-10 15:48 ` David Engster
2013-06-11 2:16 ` Eric Abrahamsen
2013-06-12 15:44 ` David Engster
2013-06-13 5:11 ` Eric Abrahamsen
2013-06-13 9:06 ` Eric Abrahamsen
2013-06-13 15:49 ` David Engster
2013-06-14 1:37 ` Eric Abrahamsen
2013-06-14 15:14 ` David Engster
2013-06-14 16:15 ` Eric Abrahamsen
[not found] ` <mailman.1680.1371226519.22516.help-gnu-emacs@gnu.org>
2013-06-14 18:29 ` Pascal J. Bourguignon [this message]
[not found] ` <mailman.1356.1370879310.22516.help-gnu-emacs@gnu.org>
2013-06-10 19:18 ` Pascal J. Bourguignon
2013-06-11 15:43 ` David Engster
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=878v2ch7gy.fsf@kuiper.lan.informatimago.com \
--to=pjb@informatimago.com \
--cc=help-gnu-emacs@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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.