From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Brandon Irizarry Newsgroups: gmane.emacs.bugs Subject: bug#66938: 30.0.50 [PATCH]: Make EIEIO :accessor behave like :reader when reading a slot's value Date: Sat, 25 Nov 2023 22:21:21 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="0000000000002b854e060b05adfe" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14095"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 66938@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 26 04:22:14 2023 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 1r75in-0003SY-Tk for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 26 Nov 2023 04:22:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r75ia-0001xi-2V; Sat, 25 Nov 2023 22:22:00 -0500 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 1r75iX-0001xD-K0 for bug-gnu-emacs@gnu.org; Sat, 25 Nov 2023 22:21:57 -0500 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 1r75iX-0004hi-AP for bug-gnu-emacs@gnu.org; Sat, 25 Nov 2023 22:21:57 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r75ic-0008J2-DX for bug-gnu-emacs@gnu.org; Sat, 25 Nov 2023 22:22:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Brandon Irizarry Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 26 Nov 2023 03:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66938 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 66938-submit@debbugs.gnu.org id=B66938.170096888431869 (code B ref 66938); Sun, 26 Nov 2023 03:22:02 +0000 Original-Received: (at 66938) by debbugs.gnu.org; 26 Nov 2023 03:21:24 +0000 Original-Received: from localhost ([127.0.0.1]:40560 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r75i0-0008Hw-0z for submit@debbugs.gnu.org; Sat, 25 Nov 2023 22:21:24 -0500 Original-Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]:53266) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r75hw-0008HZ-Ix for 66938@debbugs.gnu.org; Sat, 25 Nov 2023 22:21:21 -0500 Original-Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-5098e423ba2so4518271e87.2 for <66938@debbugs.gnu.org>; Sat, 25 Nov 2023 19:21:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700968868; x=1701573668; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=VR0vq6fAJhjccAKdxoS2y5sOzqmz/EpIaKgk8F1cmlY=; b=UKUm1lKraSLJynVYM9zMnHPwgnjso72aWj+8aEeUdbCVaTqGDqP2kWvtrdDrhOI4Js Jt1sXerMP4ixyTScuP/tF8292pRvNxDA57Iv8SZXXuT8dFbxPdZuwvdwtuGknDAqoPo2 3c677hnqpGTT89Ex/6XUmWOX4qUE2sHharbmKdkE0yQMPuJsFd0Jo8IGSnUIYBvYrlVu dtP4xS4qdX93i4hJr8zJtKe8RCYqtHqGmFxe/sTopBQEngGkpRF2gzBA03eGQRbjuhLW b8oSxRaYC5PpSQuC2e4aEDZVk79DmfxYAsL7ZAJkZDV3oCTB/s1LzxEvjTD+IfRbLnKU gn/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700968868; x=1701573668; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=VR0vq6fAJhjccAKdxoS2y5sOzqmz/EpIaKgk8F1cmlY=; b=gXA+LF7BqoNRnr8ClaV7P0/8hJmrjPZ/Nrh6X5YDGIdOSk3Ky/5On9/iiGe4BFyWCQ ErCJHl8ZQO7LcM+eDCiNeg68/OXYShdvQgk8gaWT7IkvS9ACI7Oz50H1rruBSBXHWFrP Dgsv1OwDGC/qJ25KqemjJxPQcJ2g45tWKOVeRYL0H0HQbotSimKaPfDsPoij6LF8BE+i lDSY+55nYPk64S48YDLMP0ssD6fv8It9ib/uUyBppZ7F2a4x9Fdf6dmyil6+HgmS8yAX LPDOdBkB40DLNlvUOJ9qwCjXoPWbHgOhT732AzaOfiYaMRo0ycYZh2AVqZ9yUmkiDZEX vqXA== X-Gm-Message-State: AOJu0Yx8B/u8deP9h0tYNQj4K97vLnGdoQ60FvMeYKlGMuAm7Sajtz9J jC3qoIJVS3/7tgxpR+fUF8VyP7PjmPrSX1ASiAEW4ch1 X-Google-Smtp-Source: AGHT+IF4XTUBsqcZGCNi+Kd4iTSiIiyVS+vB00pQTWK2PYU5IKReafZwu7eRwtqyWX04KByxCCMw0sEY+kh9haiiH5Q= X-Received: by 2002:a05:6512:308b:b0:509:3258:687d with SMTP id z11-20020a056512308b00b005093258687dmr6870423lfd.2.1700968868310; Sat, 25 Nov 2023 19:21:08 -0800 (PST) In-Reply-To: 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:275034 Archived-At: --0000000000002b854e060b05adfe Content-Type: multipart/alternative; boundary="0000000000002b854e060b05adfc" --0000000000002b854e060b05adfc Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Done. The patch is included with this email. - Brandon On Sat, Nov 25, 2023 at 9:57=E2=80=AFAM Stefan Monnier wrote: > [ Sorry for the delay, and thanks Eli for re-pinging me. ] > > > I've included a suggested patch for 'eieio.el', which slightly > > modifies the behavior of EIEIO's 'defclass'. When playing around with > > 'eieio-instance-inheritor' as a base class, I noticed that calls to > > the accessor (when used as a getter) weren't delegating to the parent > > instance (as defined when calling 'clone'). That is, an object clone th= at > > doesn't set > > its fields directly will report 'nil' when the accessor method is used > as a > > getter for some slot. > > The patch looks great and confirms my FIXME. > > Could you turn the example in the commit message into a test in > test/lisp/emacs-lisp/eieio-tests/eieio-tests.el? > > > Stefan > > --0000000000002b854e060b05adfc Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Done. The patch is included with this email.

- Brandon

On Sat, Nov 25, 2023 at 9:57=E2=80=AFAM= Stefan Monnier <monnier@iro= .umontreal.ca> wrote:
[ Sorry for the delay, and thanks Eli for re-pinging me.=C2=A0= ]

> I've included a suggested patch for 'eieio.el', which slig= htly
> modifies the behavior of EIEIO's 'defclass'. When playing = around with
> 'eieio-instance-inheritor' as a base class, I noticed that cal= ls to
> the accessor (when used as a getter) weren't delegating to the par= ent
> instance (as defined when calling 'clone'). That is, an object= clone that
> doesn't set
> its fields directly will report 'nil' when the accessor method= is used as a
> getter for some slot.

The patch looks great and confirms my FIXME.

Could you turn the example in the commit message into a test in
test/lisp/emacs-lisp/eieio-tests/eieio-tests.el?


=C2=A0 =C2=A0 =C2=A0 =C2=A0 Stefan

--0000000000002b854e060b05adfc-- --0000000000002b854e060b05adfe Content-Type: text/x-patch; charset="US-ASCII"; name="0001-Bug-66938-add-example-used-in-patch-commit-message-t.patch" Content-Disposition: attachment; filename="0001-Bug-66938-add-example-used-in-patch-commit-message-t.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_lpewxjgr0 RnJvbSAzNTNkY2IzMzMzMzAwYTZmODZmN2JmYTIxMGQ3MDQ4NzZlYzdiNzAxIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiAiQnJhbmRvbiBDLiBJcml6YXJyeSIgPGJyYW5kb24uaXJpemFy cnlAZ21haWwuY29tPgpEYXRlOiBTYXQsIDI1IE5vdiAyMDIzIDIyOjA5OjAwIC0wNTAwClN1Ympl Y3Q6IFtQQVRDSF0gQnVnIDY2OTM4OiBhZGQgZXhhbXBsZSB1c2VkIGluIHBhdGNoIGNvbW1pdCBt ZXNzYWdlIHRvCiBlaWVpby10ZXN0cy5lbAoKVGhpcyBpcyBpbiByZXNwb25zZSB0byBhIHJlcXVl c3QgbWFkZSBieSBTdGVmYW4gTW9ubmllciBvbgpidWctZ251LWVtYWNzLgotLS0KIC4uLi9lbWFj cy1saXNwL2VpZWlvLXRlc3RzL2VpZWlvLXRlc3RzLmVsICAgICB8IDIxICsrKysrKysrKysrKysr KysrKysKIDEgZmlsZSBjaGFuZ2VkLCAyMSBpbnNlcnRpb25zKCspCgpkaWZmIC0tZ2l0IGEvdGVz dC9saXNwL2VtYWNzLWxpc3AvZWllaW8tdGVzdHMvZWllaW8tdGVzdHMuZWwgYi90ZXN0L2xpc3Av ZW1hY3MtbGlzcC9laWVpby10Z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