From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#73505: EIEIO manual out of date, doesn't reflect current functionality Date: Fri, 27 Sep 2024 09:59:53 +0300 Message-ID: <86setl8tue.fsf@gnu.org> References: <93_8XMSOOu0_kIfElCZTcNDPXyZ0rUh6CXkKtDd-CGAYsSFXcWMggsZyqtlqrYmDQOVMziu5T8CIQ4zL0VrnpKVl85vZ4pCE-cXyL3rHL9Q=@proton.me> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3526"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 73505@debbugs.gnu.org To: zyd , Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 27 09:01:11 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1su4yU-0000gD-4s for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 27 Sep 2024 09:01:10 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1su4yG-0008Ex-Fr; Fri, 27 Sep 2024 03:00:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1su4xw-0008DL-Se for bug-gnu-emacs@gnu.org; Fri, 27 Sep 2024 03:00:38 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1su4xt-0000be-HB for bug-gnu-emacs@gnu.org; Fri, 27 Sep 2024 03:00:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-version:References:In-Reply-To:From:Date:To:Subject; bh=+lWQZ7RlHj6l7mV50Fz+1Lz3nW10CcobyOuXzjBfCYU=; b=jGX0V9FXXnYKYrQjPZnWa2BRvg7jXI4jFoPoeZUPKzETOosMjwcNd91eLcFMSg/aY1Ch/U+UBw4/cZ3i/s5daShDVtJiRtM/MXL8kgH4Xix1HSh0aHbZY0ZaZi/CAlNPkNyOxVXmnnXCCgPOOwQp7NMZDbEPcEuGZlXVkuTojAP5/hVebGJTZYkNmzvg285z/KtKtNiCrY56OWRXno1WWbd4DShy46oWex04CX7YLu01jkcgXB+Fve1OaQJygxP/RXfcIw/qWUB1tfq178P5GRG5/qL1e8kt+HB4BDp4UKQ1+CuaEHpWQve5JxC6MVxqS6zgvPN41RxnG29RJ9QTVg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1su4yL-0002We-LD for bug-gnu-emacs@gnu.org; Fri, 27 Sep 2024 03:01:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 27 Sep 2024 07:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73505 X-GNU-PR-Package: emacs Original-Received: via spool by 73505-submit@debbugs.gnu.org id=B73505.17274204339303 (code B ref 73505); Fri, 27 Sep 2024 07:01:01 +0000 Original-Received: (at 73505) by debbugs.gnu.org; 27 Sep 2024 07:00:33 +0000 Original-Received: from localhost ([127.0.0.1]:45346 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1su4xt-0002Pr-58 for submit@debbugs.gnu.org; Fri, 27 Sep 2024 03:00:33 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:48492) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1su4xr-0002NZ-MM for 73505@debbugs.gnu.org; Fri, 27 Sep 2024 03:00:32 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1su4xJ-0000NB-00; Fri, 27 Sep 2024 02:59:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=+lWQZ7RlHj6l7mV50Fz+1Lz3nW10CcobyOuXzjBfCYU=; b=ZXYdf1Cv9TadiKf3AgaH f7ncWS+hgymNXfvH2UZCpJXSdGfkoeo/vq3S/dtO5zb+5dwh73Mu0OkMItvjUp7vompqo+SBT8blt zZaKzCrIkbJlff6lFRWAEQFd/MFcU4Sfpe7VBMJ1C3EmLEqQdkPwEH2cZrs8avFYBUWdGeJ93Y15a qrUYk6pHb5gZOQE851NeXQi+Tgt498pXm+oUrzIuTzwCrc+JBRcnTRtHUfXZEuPu4hky6gZjApW6h fy3NGOgMv4VHXqhh7EEyBPesxLpj2oIsBsA+B+BnSLo4pcZU7d8DWth14/BvQtVNLvFg0xGLStyH3 AgDOnF1flfrJhQ==; In-Reply-To: <93_8XMSOOu0_kIfElCZTcNDPXyZ0rUh6CXkKtDd-CGAYsSFXcWMggsZyqtlqrYmDQOVMziu5T8CIQ4zL0VrnpKVl85vZ4pCE-cXyL3rHL9Q=@proton.me> (bug-gnu-emacs@gnu.org) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:292495 Archived-At: > Date: Thu, 26 Sep 2024 22:45:27 +0000 > From: zyd via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > 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.