From: Eli Zaretskii <eliz@gnu.org>
To: zyd <zyd-p@proton.me>, Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 73505@debbugs.gnu.org
Subject: bug#73505: EIEIO manual out of date, doesn't reflect current functionality
Date: Fri, 27 Sep 2024 09:59:53 +0300 [thread overview]
Message-ID: <86setl8tue.fsf@gnu.org> (raw)
In-Reply-To: <93_8XMSOOu0_kIfElCZTcNDPXyZ0rUh6CXkKtDd-CGAYsSFXcWMggsZyqtlqrYmDQOVMziu5T8CIQ4zL0VrnpKVl85vZ4pCE-cXyL3rHL9Q=@proton.me> (bug-gnu-emacs@gnu.org)
> Date: Thu, 26 Sep 2024 22:45:27 +0000
> From: zyd via "Bug reports for GNU Emacs,
> the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>
> The info manual for EIEIO seems to be out of date, specifically the introduction
> section:
>
> (info "(eieio) Introduction")
>
> Therein it's stated that EIEIO lacks support for both eql specializers and
> `:around' methods
>
>
> > EQL specialization
> > EIEIO does not support it.
> >
> > ‘:around’ method tag
> > This CLOS method tag is non-functional.
>
>
> But this isn't true at all, EIEIO has both of these features fully functional in
> fact.
>
> -------------------------------------------------------------------------------
>
> (cl-defgeneric inform-chat (msg preamble))
>
> (cl-defmethod inform-chat (msg (preamble (eql :night)))
> (message "Good night chat, %s" msg))
>
> (cl-defmethod inform-chat (msg (preamble (eql :morning)))
> (message "Good morning chat, %s" msg))
>
> (inform-chat "that's all she wrote. What more do you want from me?" :night)
> ;; => "Good night chat, that's all she wrote. What more do you want from me?"
>
> (inform-chat "many mornings such as this one, today is different! Today is the day I tell you all my hot takes." :morning)
> ;; => "Good morning chat, many mornings such as this one, but today is the day I
> ;; tell you all my hot takes."
>
> (cl-defmethod inform-chat :around (msg (preamble (eql :morning)))
> (setq msg (concat "even though there are " msg " Now I know, I know... you're sick of them but I must. I'm compelled, even!"))
> (cl-call-next-method msg preamble))
>
> (inform-chat "many mornings such as this one, today is different! Today is the day I tell you all my hot takes." :morning)
> ;; => "Good morning chat, even though there are many mornings such as this one,
> ;; today is different! Today is the day I tell you all my hot takes. Now I know,
> ;; I know... you're sick of them but I must. I'm compelled, even!"
>
> -------------------------------------------------------------------------------
>
> So I wonder, how much of the rest of the manual is out of date like this? Is it
> not to be trusted as a source of factual information about the current state of
> CLOS in elisp?
You are using above cl-defgeneric and cl-defmethod, which are not part
of EIEIO. So I think the EIEIO manual is not mistaken in what it
says. But maybe I'm missing something. Adding Stefan who might have
comments.
next prev parent reply other threads:[~2024-09-27 6:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-26 22:45 bug#73505: EIEIO manual out of date, doesn't reflect current functionality zyd via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-27 6:59 ` Eli Zaretskii [this message]
2024-09-27 8:08 ` zyd via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-27 12:48 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-27 13:01 ` Eli Zaretskii
2024-09-27 13:15 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-27 13:23 ` Eli Zaretskii
2024-09-27 14:35 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
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/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86setl8tue.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=73505@debbugs.gnu.org \
--cc=monnier@iro.umontreal.ca \
--cc=zyd-p@proton.me \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).