From unknown Fri Jun 20 19:58:35 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40562: [patch] Treat records as arrays in ert object comparisons and add support for cl-structs Resent-From: =?UTF-8?Q?Cl=C3=A9ment?= Pit-Claudel Original-Sender: "Debbugs-submit" Resent-CC: lars@nocrew.org, bug-gnu-emacs@gnu.org Resent-Date: Sat, 11 Apr 2020 20:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 40562 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 40562@debbugs.gnu.org Cc: lars X-Debbugs-Original-To: bug-gnu-emacs X-Debbugs-Original-Xcc: lars Received: via spool by submit@debbugs.gnu.org id=B.158663730618988 (code B ref -1); Sat, 11 Apr 2020 20:36:01 +0000 Received: (at submit) by debbugs.gnu.org; 11 Apr 2020 20:35:06 +0000 Received: from localhost ([127.0.0.1]:57140 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNMqH-0004wC-Ug for submit@debbugs.gnu.org; Sat, 11 Apr 2020 16:35:06 -0400 Received: from lists.gnu.org ([209.51.188.17]:41762) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNMqF-0004w3-Ue for submit@debbugs.gnu.org; Sat, 11 Apr 2020 16:35:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47029) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jNMqE-0000Qi-4V for bug-gnu-emacs@gnu.org; Sat, 11 Apr 2020 16:35:03 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_40,FREEMAIL_FROM, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jNMqC-0000Bi-UR for bug-gnu-emacs@gnu.org; Sat, 11 Apr 2020 16:35:02 -0400 Received: from mail-qk1-x731.google.com ([2607:f8b0:4864:20::731]:43181) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jNMqC-0000BF-Nw for bug-gnu-emacs@gnu.org; Sat, 11 Apr 2020 16:35:00 -0400 Received: by mail-qk1-x731.google.com with SMTP id 13so5717629qko.10 for ; Sat, 11 Apr 2020 13:35:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-language; bh=ZohFPaliXGsVYsPxwa5kODxCD1uPTbTPATkcBDKPKi8=; b=fxk1t+KlDNXWTuRxz57KCJ7yH0hwyOoAunSEx+uphkzGxxO5NTvsCW1sKSRQzMC/fT 2p/rZnnpTBrSy9UHduNgxf+DOU0BUwJbLhzM5uLCMLoLCFqobVnyYLS7tnyH/KP3P8TH gukRXkwmsAmTdscfiofapIHflENCzCbWk9y1DJgXAMCXnT4iq+A3eNS28MvOoMHTWTQq z3DZbKg05amq9FuPYLCe61lpULcfRzC7HK71pzXHT6RWrGrnfIoBaWzelZjpRxgFUhg8 ZhgpRABVi5NTIBae3BlLMHJe1E8Q9ab98Y02HJmeS9vRx8dIgpDkgIvLaz6cOgtyDd2q dJLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language; bh=ZohFPaliXGsVYsPxwa5kODxCD1uPTbTPATkcBDKPKi8=; b=AyqbcGyVPNi3wO0sNDwzvEFKmC7Ll3No9pQV4S0Ao9heCVVhOO/r1DDepdN1EVPcoZ gKyjFAWfg1uNfZXAs2CP2bff0F9QJRaMEToCGADZMWPKYtxpbsVjQkHEJ94XjlYi85gN I3dik+lSLSCwQlkRztlnaP5Z455DsKyVGsTKLKLh7SVIvQRQWA+e3c0E+koaD0Wlwpi6 /Q1JzmTYuSZ71VWwjRs1dfgybkAI+sL5G6Nkq05ErocwWMfK5LuV8SYu8wV6p7hadT6L TJcKDGQsNrsVxRMx6//FeXJf5Q5kqATj1UVKS1351kwDHHTbfr9Y4DkLyA9dmvNz7LE0 D92A== X-Gm-Message-State: AGi0PuYc+RND5BHhRaqp/rchyzJJ/gxawYlEyDf9wRPMvrAhwZZ3g3/4 LIXfIOXw3RxzqyixaKElM6cmzTB9 X-Google-Smtp-Source: APiQypJtOSbdR1jv93PFIkhIkDv1H5aIiqZWJi8Fo5hSwP3+MsPQGlz2DNLD8zrSeHeTsO8iRQvTpw== X-Received: by 2002:a37:882:: with SMTP id 124mr5927678qki.139.1586637299448; Sat, 11 Apr 2020 13:34:59 -0700 (PDT) Received: from ?IPv6:2601:184:4180:66e7:a4a6:abeb:cc22:e19f? ([2601:184:4180:66e7:a4a6:abeb:cc22:e19f]) by smtp.googlemail.com with ESMTPSA id a202sm4419938qkg.84.2020.04.11.13.34.58 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 11 Apr 2020 13:34:58 -0700 (PDT) From: =?UTF-8?Q?Cl=C3=A9ment?= Pit-Claudel Message-ID: Date: Sat, 11 Apr 2020 16:34:57 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------9C2C856263FE2D2ED83E14C4" Content-Language: en-GB X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::731 X-Spam-Score: 2.3 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi all, With the introduction of native records ert lost the ability to peek inside structures when comparing unequal values: (require 'ert) (cl-defstruct xyz a b c) (defvar xyz123 (make-xyz :a 1 :b 2 :c 3)) (defvar xyz143 (make-xyz :a 1 :b 4 :c 3)) (should (equal xyz123 xyz143)) Content analysis details: (2.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: live.com] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [209.51.188.17 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (cpitclaudel[at]gmail.com) 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 2.0 SPOOFED_FREEMAIL No description available. X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) This is a multi-part message in MIME format. --------------9C2C856263FE2D2ED83E14C4 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Hi all, With the introduction of native records ert lost the ability to peek inside structures when comparing unequal values: (require 'ert) (cl-defstruct xyz a b c) (defvar xyz123 (make-xyz :a 1 :b 2 :c 3)) (defvar xyz143 (make-xyz :a 1 :b 4 :c 3)) (should (equal xyz123 xyz143)) Emacs 25 said this: Test failed: ((should (equal xyz123 xyz143)) :form (equal [cl-struct-xyz 1 2 3 nil] [cl-struct-xyz 1 4 3 nil]) :value nil :explanation (array-elt 2 (different-atoms (2 "#x2" "?") (4 "#x4" "?")))) Emacs 26 says this: Test failed: ((should (equal xyz123 xyz143)) :form (equal #s(xyz 1 2 3) #s(xyz 1 4 3)) :value nil :explanation (different-atoms #s(xyz 1 2 3) #s(xyz 1 4 3))) The first attached patch fixes this for all records. The second patch adds special support for cl-structs, to get this: Test failed: ((should (equal xyz123 xyz143)) :form (equal #s(xyz 1 2 3) #s(xyz 1 4 3)) :value nil :explanation (struct-field c (different-atoms (2 "#x2" "?") (4 "#x4" "?")))) Clément. --------------9C2C856263FE2D2ED83E14C4 Content-Type: text/x-patch; charset=UTF-8; name="0001-lisp-emacs-lisp-ert.el-ert-explain-equal-rec-Treat-r.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-lisp-emacs-lisp-ert.el-ert-explain-equal-rec-Treat-r.pa"; filename*1="tch" >From 1f9936f1f1f8428b9ddebec04a4a865719543cf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Pit-Claudel?= Date: Sat, 11 Apr 2020 16:22:56 -0400 Subject: [PATCH 1/2] * lisp/emacs-lisp/ert.el (ert--explain-equal-rec): Treat records as arrays --- lisp/emacs-lisp/ert.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el index 764354b03b..74202183cc 100644 --- a/lisp/emacs-lisp/ert.el +++ b/lisp/emacs-lisp/ert.el @@ -515,7 +515,7 @@ ert--explain-equal-rec `(cdr ,cdr-x) (cl-assert (equal a b) t) nil)))))))) - ((pred arrayp) + ((or (pred arrayp) (pred recordp)) ;; For mixed unibyte/multibyte string comparisons, make both multibyte. (when (and (stringp a) (xor (multibyte-string-p a) (multibyte-string-p b))) -- 2.17.1 --------------9C2C856263FE2D2ED83E14C4 Content-Type: text/x-patch; charset=UTF-8; name="0002-lisp-emacs-lisp-ert.el-ert-explain-equal-rec-Add-sup.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0002-lisp-emacs-lisp-ert.el-ert-explain-equal-rec-Add-sup.pa"; filename*1="tch" >From 47eb414118ab41b32c613fcdbe86369b2efd4c56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Pit-Claudel?= Date: Sat, 11 Apr 2020 16:23:47 -0400 Subject: [PATCH 2/2] * lisp/emacs-lisp/ert.el (ert--explain-equal-rec): Add support for cl-structs --- lisp/emacs-lisp/ert.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el index 74202183cc..e3666a84c0 100644 --- a/lisp/emacs-lisp/ert.el +++ b/lisp/emacs-lisp/ert.el @@ -515,6 +515,13 @@ ert--explain-equal-rec `(cdr ,cdr-x) (cl-assert (equal a b) t) nil)))))))) + ((pred cl-struct-p) + (cl-loop for slot in (cdr (cl-struct-slot-info (type-of a))) + for ai across a + for bi across b + for xf = (ert--explain-equal-rec ai bi) + do (when xf (cl-return `(struct-field ,(car slot) ,xf))) + finally (cl-assert (equal a b) t))) ((or (pred arrayp) (pred recordp)) ;; For mixed unibyte/multibyte string comparisons, make both multibyte. (when (and (stringp a) -- 2.17.1 --------------9C2C856263FE2D2ED83E14C4-- From unknown Fri Jun 20 19:58:35 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40562: [patch] Treat records as arrays in ert object comparisons and add support for cl-structs Resent-From: =?UTF-8?Q?=C5=A0t=C4=9Bp=C3=A1n_?= =?UTF-8?Q?N=C4=9Bmec?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 11 Apr 2020 23:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40562 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: =?UTF-8?Q?Cl=C3=A9ment?= Pit-Claudel Cc: lars , 40562@debbugs.gnu.org Received: via spool by 40562-submit@debbugs.gnu.org id=B40562.15866475751566 (code B ref 40562); Sat, 11 Apr 2020 23:27:02 +0000 Received: (at 40562) by debbugs.gnu.org; 11 Apr 2020 23:26:15 +0000 Received: from localhost ([127.0.0.1]:57180 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNPVv-0000PC-H7 for submit@debbugs.gnu.org; Sat, 11 Apr 2020 19:26:15 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:45426) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNPVt-0000Ox-Kj for 40562@debbugs.gnu.org; Sat, 11 Apr 2020 19:26:14 -0400 Received: by mail-lf1-f66.google.com with SMTP id f8so3870750lfe.12 for <40562@debbugs.gnu.org>; Sat, 11 Apr 2020 16:26:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-transfer-encoding; bh=oCNCTCQFbnS2pw55HZyFve7NS7lKDmWzDEn9drtDwOQ=; b=PLGJdZz/g/nAChNU/8lTUHzsvUj3KyGeBUjZZUEM5+7LVgam/flq2YliMkMlnLH3vO xMNvUpzIuS6bs8omO413pVOSgEN506OXDZWZXZ4Jq110X7EEp5Tq1xsmBoag1ZbyfL3p YEJzSO0cINBh1KeeeEpwQPkxlhMIWSGG3q8IYkHwunlILHxDHWpLGI4Fzx8oo0UKDNY5 NkRLw+x1MvBwqVlWCZUGbb7clWKMHneTRfiyjgnIjD+WykIGlYc7mIEF3CzJWA3ji3/L 8PY+DrY6EGfBKJaf2mAfGboe2AsAkcAa6jE8hTpqbuuIT9/QlFI8xlRLRvU/7Y6lsYx9 MTqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references :user-agent:date:message-id:mime-version:content-transfer-encoding; bh=oCNCTCQFbnS2pw55HZyFve7NS7lKDmWzDEn9drtDwOQ=; b=WgEaik7ARN/oKJ7pwKnmedFu1HUhIlBFxhfMVoFLHU5s/4OkWXNlvWvryRI8p1VMNv QJDI9EdOnmidHzbHDo3gTAPpTRamLMpNWT9QzKhNO/RFepFA6QEQGjAbxXDT8yIV18iK S0hT4vg2i8jDb/9A0hk0goWZQ8DKxkjMEiSfJU7nyvi+U6/fSgfLqtnUkj3okzrHuZXI mnxtxZXPWBibbLwBiyUCc4+Lawu9hv0CqbohHtNl4fY6IYETlBhzF157VXe+F04xnpGz B9pTrdKNvJo/f6Yey88brFbQ6UCnrJM7DrLqkE5Vf7Ghs0QlfQIQuDTbzn49zah83mhG jo+A== X-Gm-Message-State: AGi0PuYNY3yIIwPGb9VUny61609dcDpaVFkgC+JJEau5Q3nhDhFNo7mi uY+Djosk3Gmn8vdMSoAnT9M= X-Google-Smtp-Source: APiQypJVZFYUH6JqDUnvt5gesEPhr0OQfGDApqIMBNm7q8kWjnyDccgMgc5M37LSK32pr0a/Fb6O5w== X-Received: by 2002:ac2:4554:: with SMTP id j20mr6463377lfm.91.1586647567650; Sat, 11 Apr 2020 16:26:07 -0700 (PDT) Received: from localhost ([185.112.167.47]) by smtp.gmail.com with ESMTPSA id o21sm4356727ljg.71.2020.04.11.16.26.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Apr 2020 16:26:07 -0700 (PDT) From: =?UTF-8?Q?=C5=A0t=C4=9Bp=C3=A1n_?= =?UTF-8?Q?N=C4=9Bmec?= In-Reply-To: ("=?UTF-8?Q?Cl=C3=A9ment?= Pit-Claudel"'s message of "Sat, 11 Apr 2020 16:34:57 -0400") References: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Date: Sun, 12 Apr 2020 01:26:41 +0200 Message-ID: <87a73heh8u.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Sat, 11 Apr 2020 16:34:57 -0400 Cl=C3=A9ment Pit-Claudel wrote: [...] > (defvar xyz123 (make-xyz :a 1 :b 2 :c 3)) > (defvar xyz143 (make-xyz :a 1 :b 4 :c 3)) [...] > The first attached patch fixes this for all records. Seems like a nice addition. > Test failed: ((should (equal xyz123 xyz143))=20 > :form (equal #s(xyz 1 2 3) #s(xyz 1 4 3)) > :value nil > :explanation (struct-field c (different-atoms (2 "#x2" "?") (4 "#x4" "?= ")))) ^gotcha > lisp/emacs-lisp/ert.el | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el > index 74202183cc..e3666a84c0 100644 > --- a/lisp/emacs-lisp/ert.el > +++ b/lisp/emacs-lisp/ert.el > @@ -515,6 +515,13 @@ ert--explain-equal-rec > `(cdr ,cdr-x) > (cl-assert (equal a b) t) > nil)))))))) > + ((pred cl-struct-p) > + (cl-loop for slot in (cdr (cl-struct-slot-info (type-of a))) > + for ai across a ^^^^^^^^^^^^^^^ This is incorrect, as witnessed by your very example (`c' instead of `b'). Records are accessible with `aref', but the first slot is the type descriptor, so you're making an off-by-one error here. > + for bi across b > + for xf =3D (ert--explain-equal-rec ai bi) > + do (when xf (cl-return `(struct-field ,(car slot) ,xf))) > + finally (cl-assert (equal a b) t))) > ((or (pred arrayp) (pred recordp)) > ;; For mixed unibyte/multibyte string comparisons, make both mult= ibyte. > (when (and (stringp a) Thanks, =C5=A0t=C4=9Bp=C3=A1n From unknown Fri Jun 20 19:58:35 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40562: [patch] Treat records as arrays in ert object comparisons and add support for cl-structs Resent-From: =?UTF-8?Q?Cl=C3=A9ment?= Pit-Claudel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 12 Apr 2020 03:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40562 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: =?UTF-8?Q?=C5=A0t=C4=9Bp=C3=A1n_?= =?UTF-8?Q?N=C4=9Bmec?= Cc: lars , 40562@debbugs.gnu.org Received: via spool by 40562-submit@debbugs.gnu.org id=B40562.158666081629223 (code B ref 40562); Sun, 12 Apr 2020 03:07:02 +0000 Received: (at 40562) by debbugs.gnu.org; 12 Apr 2020 03:06:56 +0000 Received: from localhost ([127.0.0.1]:57255 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNSxU-0007bG-8o for submit@debbugs.gnu.org; Sat, 11 Apr 2020 23:06:56 -0400 Received: from mail-qk1-f173.google.com ([209.85.222.173]:34416) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNSxT-0007b5-7s for 40562@debbugs.gnu.org; Sat, 11 Apr 2020 23:06:55 -0400 Received: by mail-qk1-f173.google.com with SMTP id t3so2488566qkg.1 for <40562@debbugs.gnu.org>; Sat, 11 Apr 2020 20:06:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=JEvX+5cnsoIehHqsnZGJ6zFkGt6isV9oXFxqeyz0SsY=; b=m72SnrjFEKSacV9noYQxIjyHG4ZaDwArtU3AWHs2LUSo7RwUhD9/8SPjKoSlFombnj 77Dg2gO9PPTJtQUP99mniDIEdZU3V8JGcH3edAPiTOXZbr1EVA0N7UynoW2qCT5E9ayI 5e36XDlNYbFKgcvGP/g0n1kuUED+MRfLmwYsY/4M5Q2LPcpOguq27gspXUl64HRlxGK1 BBg4x3jLg4h7mkLZsNI43avEEBPbwiAu95jXszJPrIHOp7iQPxkqdPfp3mu6gvh8Kfe2 7gdoDsG/aVI7JWOQfTrqTJwWO+oyJVjVDymunIlmyUfu33oygK+Y6SUPyzRdQwVwRLre 4WLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=JEvX+5cnsoIehHqsnZGJ6zFkGt6isV9oXFxqeyz0SsY=; b=AqsDniY3p7/Wb1c1KvFlBn6hkoUDgahbgJL1RpyvyR0fjwG+7z6d1bUbOyaOJVS04w nxnn5Dsr8igf2w3FpsLAZclNfVtAhAoP3omvP6ka3ChYxL0nk1khALCp1I7i7tmSyfP9 MAG3Bsyp/luMPeNoKNNh2NC5+mFiNPpbB9NpS/K3vgTDvyg7ngb0H96Fa7eNjXTe8oOx Q8EXq4KWCm4kHDi49ciy7tv7kqi0b3ZCFfI63gGiq06L5yh/CGtvmjO/NSCZursplNK4 VobEgB1a4MHk25BU/DDxTiB/DmB8kJWEnOZrbTD1bBnubOrJlPluuIzuj0F/A7x90ER9 evFg== X-Gm-Message-State: AGi0PuY8zjZEsXjeWY3y3CfIy+G75m4wZ0NCwpxhdGDuusC+MHMXsRiG C7G6bpy3YMYj8/qas6s9f60= X-Google-Smtp-Source: APiQypKhz9iRhvYgx5Mx4uF/Is84b7hwVp63c0OzqMFkgjAX3PjhNzvSedRxJQteogJQMNGA9t9IgA== X-Received: by 2002:a05:620a:718:: with SMTP id 24mr10649433qkc.280.1586660809688; Sat, 11 Apr 2020 20:06:49 -0700 (PDT) Received: from ?IPv6:2601:184:4180:66e7:a4a6:abeb:cc22:e19f? ([2601:184:4180:66e7:a4a6:abeb:cc22:e19f]) by smtp.googlemail.com with ESMTPSA id h9sm5022174qtj.3.2020.04.11.20.06.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 11 Apr 2020 20:06:48 -0700 (PDT) References: <87a73heh8u.fsf@gmail.com> From: =?UTF-8?Q?Cl=C3=A9ment?= Pit-Claudel Message-ID: <11a23fdb-4512-0b80-0426-460be4fdf1cb@gmail.com> Date: Sat, 11 Apr 2020 23:06:47 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <87a73heh8u.fsf@gmail.com> Content-Type: multipart/mixed; boundary="------------35F3058287EF953B3D050048" Content-Language: en-GB X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) This is a multi-part message in MIME format. --------------35F3058287EF953B3D050048 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit On 11/04/2020 19.26, Štěpán Němec wrote: > This is incorrect, as witnessed by your very example (`c' instead of > `b'). Records are accessible with `aref', but the first slot is the type > descriptor, so you're making an off-by-one error here. Of course, it should be `for slot in (cl-struct-slot-info (type-of a))` not `for slot in (cdr (cl-struct-slot-info (type-of a)))`. Updated patch attached. Thanks for the review! --------------35F3058287EF953B3D050048 Content-Type: text/x-patch; charset=UTF-8; name="0002-lisp-emacs-lisp-ert.el-ert-explain-equal-rec-Add-sup.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0002-lisp-emacs-lisp-ert.el-ert-explain-equal-rec-Add-sup.pa"; filename*1="tch" >From 129ba8aeaa91b6ea44a325ec237f3df7e9400c9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Pit-Claudel?= Date: Sat, 11 Apr 2020 16:23:47 -0400 Subject: [PATCH 2/2] * lisp/emacs-lisp/ert.el (ert--explain-equal-rec): Add support for cl-structs --- lisp/emacs-lisp/ert.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el index 74202183cc..241eece05b 100644 --- a/lisp/emacs-lisp/ert.el +++ b/lisp/emacs-lisp/ert.el @@ -515,6 +515,13 @@ ert--explain-equal-rec `(cdr ,cdr-x) (cl-assert (equal a b) t) nil)))))))) + ((pred cl-struct-p) + (cl-loop for slot in (cl-struct-slot-info (type-of a)) + for ai across a + for bi across b + for xf = (ert--explain-equal-rec ai bi) + do (when xf (cl-return `(struct-field ,(car slot) ,xf))) + finally (cl-assert (equal a b) t))) ((or (pred arrayp) (pred recordp)) ;; For mixed unibyte/multibyte string comparisons, make both multibyte. (when (and (stringp a) -- 2.17.1 --------------35F3058287EF953B3D050048-- From unknown Fri Jun 20 19:58:35 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40562: [patch] Treat records as arrays in ert object comparisons and add support for cl-structs Resent-From: =?UTF-8?Q?=C5=A0t=C4=9Bp=C3=A1n_?= =?UTF-8?Q?N=C4=9Bmec?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 12 Apr 2020 09:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40562 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: =?UTF-8?Q?Cl=C3=A9ment?= Pit-Claudel Cc: lars , 40562@debbugs.gnu.org Received: via spool by 40562-submit@debbugs.gnu.org id=B40562.15866834541348 (code B ref 40562); Sun, 12 Apr 2020 09:25:02 +0000 Received: (at 40562) by debbugs.gnu.org; 12 Apr 2020 09:24:14 +0000 Received: from localhost ([127.0.0.1]:57364 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNYqc-0000Lg-4a for submit@debbugs.gnu.org; Sun, 12 Apr 2020 05:24:14 -0400 Received: from mail-lj1-f173.google.com ([209.85.208.173]:38414) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNYqa-0000LT-J7 for 40562@debbugs.gnu.org; Sun, 12 Apr 2020 05:24:13 -0400 Received: by mail-lj1-f173.google.com with SMTP id v16so5990881ljg.5 for <40562@debbugs.gnu.org>; Sun, 12 Apr 2020 02:24:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-transfer-encoding; bh=4PKnpWF/Hs1x51sBj9ByHvLanlFcqstN9x+fZyBGoik=; b=JG2ItsS7D93NIgRe0u3U3AyOX5pOwVz46zwl8BEIK5wNDBKZZQaOYLWh0aYqJIbu1z 7DI4DH2AxUdme8oeJm8mqxjfpcfWxw4iU8NayQugGi7W26dlIWpNSIf9wS4t3gvCSQwf fvgvmyikChMP7J/IsuMsW7QLxUFt2pv0Z3fO9EC022a8S4F8bfRzdgLU+73oYZ6IRQ68 F6WgAiJAG50MDjA2heLO/qel/kTKJIOGBLFkA3/fmeHn0TkG+14pm+xx77MW+GT5Gyju Ja1imWgt1WERK7yKqNQcX6wnrI2ZU6UmcfpMK24l7zPmfvUpgrAwa921ONxAWlym3eos dhfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references :user-agent:date:message-id:mime-version:content-transfer-encoding; bh=4PKnpWF/Hs1x51sBj9ByHvLanlFcqstN9x+fZyBGoik=; b=NiYyWSjUH9t+UWNaK/wSlkKgz5zQqhf/dEByFFtcvl/ycYOuaUNPhUXx5hXkdwyd/c m4PdkIPEnHcAXZdb9ifsNZ+kMwjYR1RsYCd1W3wzv/+RPfz5w3ZngTZBfKSe6xJogyJo wWRABC4nFxb/8jPN8LcOiXax6GG/e3YEcrZaTOkGX/nwFsNGQptVNKjH+X1Vk9dWdM7C rL4eo3UdvUdg9hN2hz1ZkDtA3i4tKR/AWeQERZsYIqJtys6YG2sjHeK5V/O09gnC/Qpn syu1OmxlEW1DNIxTEGO5+Lg4km3ILCOWRx1BsANpj//Wki7Z2F09y5aZPrXTKjYdm7qT FarA== X-Gm-Message-State: AGi0PuYtIgNJJbeO6gniAPqXlNDypSePBRy/WZkNGB/S2eJGpAww0+eH MW4+j97/t7Di5C1GqJBEB+Y= X-Google-Smtp-Source: APiQypIbdqXa5ggE5l+lS+2t7HvKhLjS05+j1ASbuQqXVcrZHyBMvThmNYF5XhQatBh7brK65giTdA== X-Received: by 2002:a2e:8511:: with SMTP id j17mr7747332lji.292.1586683446489; Sun, 12 Apr 2020 02:24:06 -0700 (PDT) Received: from localhost ([185.112.167.47]) by smtp.gmail.com with ESMTPSA id i9sm4972494ljn.25.2020.04.12.02.24.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Apr 2020 02:24:05 -0700 (PDT) From: =?UTF-8?Q?=C5=A0t=C4=9Bp=C3=A1n_?= =?UTF-8?Q?N=C4=9Bmec?= In-Reply-To: <11a23fdb-4512-0b80-0426-460be4fdf1cb@gmail.com> ("=?UTF-8?Q?Cl=C3=A9ment?= Pit-Claudel"'s message of "Sat, 11 Apr 2020 23:06:47 -0400") References: <87a73heh8u.fsf@gmail.com> <11a23fdb-4512-0b80-0426-460be4fdf1cb@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Date: Sun, 12 Apr 2020 11:24:41 +0200 Message-ID: <875ze5dpk6.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Sat, 11 Apr 2020 23:06:47 -0400 Cl=C3=A9ment Pit-Claudel wrote: > On 11/04/2020 19.26, =C5=A0t=C4=9Bp=C3=A1n N=C4=9Bmec wrote: >> This is incorrect, as witnessed by your very example (`c' instead of >> `b'). Records are accessible with `aref', but the first slot is the type >> descriptor, so you're making an off-by-one error here. > > Of course, it should be `for slot in (cl-struct-slot-info (type-of > a))` not `for slot in (cdr (cl-struct-slot-info (type-of a)))`. > Updated patch attached. Hm, except now you're duplicating the (eq (type-of a) (type-of b)) check. I'm not quite sure it's worth complicating the code to avoid that, though, given how clumsy records currently seem to be to work with (most sequence functions don't support them). --=20 =C5=A0t=C4=9Bp=C3=A1n From unknown Fri Jun 20 19:58:35 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40562: [patch] Treat records as arrays in ert object comparisons and add support for cl-structs Resent-From: =?UTF-8?Q?Cl=C3=A9ment?= Pit-Claudel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 12 Apr 2020 15:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40562 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: =?UTF-8?Q?=C5=A0t=C4=9Bp=C3=A1n_?= =?UTF-8?Q?N=C4=9Bmec?= Cc: lars , 40562@debbugs.gnu.org Received: via spool by 40562-submit@debbugs.gnu.org id=B40562.158670665414973 (code B ref 40562); Sun, 12 Apr 2020 15:51:02 +0000 Received: (at 40562) by debbugs.gnu.org; 12 Apr 2020 15:50:54 +0000 Received: from localhost ([127.0.0.1]:58689 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNeso-0003tR-Jy for submit@debbugs.gnu.org; Sun, 12 Apr 2020 11:50:54 -0400 Received: from mail-qt1-f174.google.com ([209.85.160.174]:46432) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNesm-0003tD-B7 for 40562@debbugs.gnu.org; Sun, 12 Apr 2020 11:50:52 -0400 Received: by mail-qt1-f174.google.com with SMTP id i19so2499253qtp.13 for <40562@debbugs.gnu.org>; Sun, 12 Apr 2020 08:50:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=fYbwScipu60tc9L823mUbf1IUegS2/irrNH9r2q+5ak=; b=rQZLIxy5a9GC6iXbKG59qCb9EJecTKevuzKibInt4a7n4P1G3MqCMr+fOU7X3m2Hmp EF/nZtPptX8nCtpTfUTvYVap6EDMLdfD12ZFm6nBjnZ5dsyqDMgWskHvvo1hiWmpYKTS ye+KPWD1pQTm4+Kkt9LtmfW5ICrhBWZNL6UmzX5nsEaEzuhxLuYF01zd5iA+WDV4+pLt dEP7CVCWcvDlzpCEEVUjbbiPUTw3Ygn1RmqB9Y9TXYeDd1jiCdNNV6xKiVsgGzqAhFTf IsT9bGBTMUAItQSji4GnkfF2enow3v7xem1xun69zb5l8O6lOusatl+Az39u7ttH8HJ4 zUkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=fYbwScipu60tc9L823mUbf1IUegS2/irrNH9r2q+5ak=; b=pb8YcaRQtloUS/J9ASvLXw/P11PtY1bO2KPyPI7RJCWtvhWYoMux9pwvj/GvC2Uiyc t1q5xTwCWtK7OPLCPf/saevhTN2apZn4geDzYBFL3SqRSJ/O0g0HxtWMhxVUg83k0aFl YBwN1FjGStfAIrwrw2oH1yo/pPN0z+1TqiLQL/JsYaI1dOSP1WwUChadpFgxEsd56UTB BwUaWjfjxL5wgqtOaHRKWiGsl0JxsSuNZJm9hu40L14+NxCXM0I9LR9rZoDWLoIGOwfA 4u0YCU7TtR7tzA250f7dqveD3Pef/KhZm1nTdAEhgxulZdMFYi+1+KTMgy7LyKmxFr0B Z1Pg== X-Gm-Message-State: AGi0Pua+Qa/RyN6Jw7/zFm7X37VwqiBTXoYNdFbDOKsFDqujB7xEzKHq 8alj8Jz0YdBr4F3KAQx23zJKeJdh X-Google-Smtp-Source: APiQypK8377G70MOMO/QWXwJKuFgQA/7sdj5pjLZtNP1LxldX7EWPJ8+oTUlX3AgeonV3RITU3ZTiA== X-Received: by 2002:ac8:6987:: with SMTP id o7mr7908680qtq.118.1586706646419; Sun, 12 Apr 2020 08:50:46 -0700 (PDT) Received: from ?IPv6:2601:184:4180:66e7:a4a6:abeb:cc22:e19f? ([2601:184:4180:66e7:a4a6:abeb:cc22:e19f]) by smtp.googlemail.com with ESMTPSA id s85sm6192039qke.50.2020.04.12.08.50.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 12 Apr 2020 08:50:45 -0700 (PDT) References: <87a73heh8u.fsf@gmail.com> <11a23fdb-4512-0b80-0426-460be4fdf1cb@gmail.com> <875ze5dpk6.fsf@gmail.com> From: =?UTF-8?Q?Cl=C3=A9ment?= Pit-Claudel Message-ID: <275aa2c2-ec39-1d52-1a48-1d990949fdb5@gmail.com> Date: Sun, 12 Apr 2020 11:50:44 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <875ze5dpk6.fsf@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 12/04/2020 05.24, Štěpán Němec wrote: > On Sat, 11 Apr 2020 23:06:47 -0400 > Clément Pit-Claudel wrote: > >> On 11/04/2020 19.26, Štěpán Němec wrote: >>> This is incorrect, as witnessed by your very example (`c' instead of >>> `b'). Records are accessible with `aref', but the first slot is the type >>> descriptor, so you're making an off-by-one error here. >> >> Of course, it should be `for slot in (cl-struct-slot-info (type-of >> a))` not `for slot in (cdr (cl-struct-slot-info (type-of a)))`. >> Updated patch attached. > > Hm, except now you're duplicating the (eq (type-of a) (type-of b)) > check. Yup; I don't think that's a problem :) From unknown Fri Jun 20 19:58:35 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40562: [patch] Treat records as arrays in ert object comparisons and add support for cl-structs Resent-From: =?UTF-8?Q?Cl=C3=A9ment?= Pit-Claudel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 Apr 2020 21:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40562 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: =?UTF-8?Q?=C5=A0t=C4=9Bp=C3=A1n_?= =?UTF-8?Q?N=C4=9Bmec?= Cc: lars , 40562@debbugs.gnu.org Received: via spool by 40562-submit@debbugs.gnu.org id=B40562.158785008230139 (code B ref 40562); Sat, 25 Apr 2020 21:29:02 +0000 Received: (at 40562) by debbugs.gnu.org; 25 Apr 2020 21:28:02 +0000 Received: from localhost ([127.0.0.1]:60511 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jSSLC-0007pz-DV for submit@debbugs.gnu.org; Sat, 25 Apr 2020 17:28:02 -0400 Received: from mail-qk1-f176.google.com ([209.85.222.176]:35161) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jSSLA-0007pW-Qd for 40562@debbugs.gnu.org; Sat, 25 Apr 2020 17:28:01 -0400 Received: by mail-qk1-f176.google.com with SMTP id c63so14184289qke.2 for <40562@debbugs.gnu.org>; Sat, 25 Apr 2020 14:28:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=nfphdxuqvD2pg8koE2/r8bY2nq/voMifN52VQGSs+8E=; b=ipP5FzuoxDxJRoGkA5RfBKte8xUHGldRsWZLZV8zMh5mdCy7ZCIzuAsnqhDctIt+63 tKQodUrFMD5U1wDVwGvb6cvULB1daD9Mpq4HnKNi7rJQrUCz88TeLWn35YGiw9GBkcEA oM0N454yrqalc9H9rNNDauKn7ALvCdm4ycxCx1bcvBY7Oeucn0G2LniONW0vpRmzRJMN +V+kbrTP8Pzt9CesD5amci5lJExIU6BrCSRFVbh8skr+XGgN7oFXekeSwFddWl6z7KZc Vk9Mu9PJfOSgvqhMl6UvZg1ToSO9kU4egqhoStnxMS4DsQVgxDkRRS8ULoNYs7yuqvY9 EOWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=nfphdxuqvD2pg8koE2/r8bY2nq/voMifN52VQGSs+8E=; b=IkA22OCWkNnNOcMAnau3LufsnMxdxzvhqW3AfDpUdepx9b0IEVi+elS+NduCGxYJXy P+wxffSgKu0hfQxV8g10lYXqsrf4jTAMYXB69ZLEPtH0RRW5lJXhDiWD4URYiXodJgT4 gBZSMEm65bm6ZYONJ80dWPETGiJk26ISCKiS8H2cOiQV7NT30G5dM/T/qxcSfE8FepJt wSTRiMVF3U6q0l8MGaPKYF2bnxTKXFeJT6gi/+1tnipLde4TnA8q5HEa0p5XhxJnkIvq +tamN2Sw7Shd/53KgdJBJ8lAAR+KJE8KZnasduWNQnA5xefNaOw+amfTWmzXxt4ykjh/ 14qw== X-Gm-Message-State: AGi0PuaKbdqE4PGSvwTx12qngnXaszMOBTh2zw2+l7y4KBYxY1WrbabP xsGM378IvwvYfAgecJSi3lZ0/rHMXDk= X-Google-Smtp-Source: APiQypKR/rmwd35e+VP5RJya/8qt7AVsSKwlUC42jTBs7rKzJsRMZPvnf8Hbpdx3//TvgbBFjoAzUA== X-Received: by 2002:a37:a116:: with SMTP id k22mr13929664qke.99.1587850075124; Sat, 25 Apr 2020 14:27:55 -0700 (PDT) Received: from ?IPv6:2601:184:4180:66e7:54d6:bfeb:aa49:9d3b? ([2601:184:4180:66e7:54d6:bfeb:aa49:9d3b]) by smtp.googlemail.com with ESMTPSA id g47sm7058651qte.54.2020.04.25.14.27.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 25 Apr 2020 14:27:54 -0700 (PDT) From: =?UTF-8?Q?Cl=C3=A9ment?= Pit-Claudel References: <87a73heh8u.fsf@gmail.com> <11a23fdb-4512-0b80-0426-460be4fdf1cb@gmail.com> <875ze5dpk6.fsf@gmail.com> <275aa2c2-ec39-1d52-1a48-1d990949fdb5@gmail.com> Message-ID: <1d3af678-6fa3-62ba-5d6b-b85bc182608e@gmail.com> Date: Sat, 25 Apr 2020 17:27:53 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <275aa2c2-ec39-1d52-1a48-1d990949fdb5@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 12/04/2020 11.50, Clément Pit-Claudel wrote: > On 12/04/2020 05.24, Štěpán Němec wrote: >> On Sat, 11 Apr 2020 23:06:47 -0400 >> Clément Pit-Claudel wrote: >> >>> On 11/04/2020 19.26, Štěpán Němec wrote: >>>> This is incorrect, as witnessed by your very example (`c' instead of >>>> `b'). Records are accessible with `aref', but the first slot is the type >>>> descriptor, so you're making an off-by-one error here. >>> >>> Of course, it should be `for slot in (cl-struct-slot-info (type-of >>> a))` not `for slot in (cdr (cl-struct-slot-info (type-of a)))`. >>> Updated patch attached. >> >> Hm, except now you're duplicating the (eq (type-of a) (type-of b)) >> check. > > Yup; I don't think that's a problem :) Is there anything else I should do before pushing this patch? From unknown Fri Jun 20 19:58:35 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40562: [patch] Treat records as arrays in ert object comparisons and add support for cl-structs Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Aug 2020 13:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40562 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: =?UTF-8?Q?Cl=C3=A9ment?= Pit-Claudel Cc: lars , 40562@debbugs.gnu.org, =?UTF-8?Q?=C5=A0t=C4=9Bp=C3=A1n_?= =?UTF-8?Q?N=C4=9Bmec?= Received: via spool by 40562-submit@debbugs.gnu.org id=B40562.159689173826664 (code B ref 40562); Sat, 08 Aug 2020 13:03:02 +0000 Received: (at 40562) by debbugs.gnu.org; 8 Aug 2020 13:02:18 +0000 Received: from localhost ([127.0.0.1]:58480 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k4OUL-0006vo-OE for submit@debbugs.gnu.org; Sat, 08 Aug 2020 09:02:17 -0400 Received: from quimby.gnus.org ([95.216.78.240]:51472) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k4OUJ-0006qI-OS for 40562@debbugs.gnu.org; Sat, 08 Aug 2020 09:02:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=+qtuK92MQ0lvr3Wxylu8/+6wfhlpaBKaH9tt2kgyDTI=; b=EmXQ7V1YfaahVSt8/iRxIsUjqR 3CFXJK1HFspkeLXF49qr88R1Euze2PI4Yp87FyjFMdRenHUT+3mtYjNbem/4OZcJACytz3xTs6orK wx5kHPVI0v5DE60XyWviPyobq0sEcd2hhibdR3Swx8f4DNb+FeQYXL6PBTmvvnlPHh/c=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k4OUB-0004Zb-0R; Sat, 08 Aug 2020 15:02:09 +0200 From: Lars Ingebrigtsen References: <87a73heh8u.fsf@gmail.com> <11a23fdb-4512-0b80-0426-460be4fdf1cb@gmail.com> <875ze5dpk6.fsf@gmail.com> <275aa2c2-ec39-1d52-1a48-1d990949fdb5@gmail.com> <1d3af678-6fa3-62ba-5d6b-b85bc182608e@gmail.com> Date: Sat, 08 Aug 2020 15:02:01 +0200 In-Reply-To: <1d3af678-6fa3-62ba-5d6b-b85bc182608e@gmail.com> ("=?UTF-8?Q?Cl=C3=A9ment?= Pit-Claudel"'s message of "Sat, 25 Apr 2020 17:27:53 -0400") Message-ID: <87eeoh1eba.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: =?UTF-8?Q?Cl=C3=A9ment?= Pit-Claudel writes: > Is there anything else I should do before pushing this patch? This was four months ago, so I guess you should go ahead and push the patch. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Cl=C3=A9ment Pit-Claudel writes: > Is there anything else I should do before pushing this patch? This was four months ago, so I guess you should go ahead and push the patch. --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Fri Jun 20 19:58:35 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40562: [patch] Treat records as arrays in ert object comparisons and add support for cl-structs Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 18 Aug 2020 14:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40562 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: =?UTF-8?Q?Cl=C3=A9ment?= Pit-Claudel Cc: lars , 40562@debbugs.gnu.org, =?UTF-8?Q?=C5=A0t=C4=9Bp=C3=A1n_?= =?UTF-8?Q?N=C4=9Bmec?= Received: via spool by 40562-submit@debbugs.gnu.org id=B40562.15977596467377 (code B ref 40562); Tue, 18 Aug 2020 14:08:01 +0000 Received: (at 40562) by debbugs.gnu.org; 18 Aug 2020 14:07:26 +0000 Received: from localhost ([127.0.0.1]:36552 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k82Gr-0001up-81 for submit@debbugs.gnu.org; Tue, 18 Aug 2020 10:07:26 -0400 Received: from quimby.gnus.org ([95.216.78.240]:33080) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k82Go-0001uQ-CW for 40562@debbugs.gnu.org; Tue, 18 Aug 2020 10:07:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=UsPv0s8lXSvordx6eIzxkFAlgOO2l9klA00im7o179g=; b=CmxPDAaK9OpMdcYyHvXSV/lIQO 4H13BmipwuCIk/dSv8ojyZt9M8oIrL7xwlb2DsxzY2VwlQtO2aeZNIMv/wHRwIz1pqZ1t006+9JWg NlRCN0YBt9sGRx1+Ebwkx1JnWCpNY6R5I581TcFnmEePrF7fB7EXeEsKkOK18zDf+YO8=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k82Ge-0007fv-Bs; Tue, 18 Aug 2020 16:07:15 +0200 From: Lars Ingebrigtsen References: <87a73heh8u.fsf@gmail.com> <11a23fdb-4512-0b80-0426-460be4fdf1cb@gmail.com> <875ze5dpk6.fsf@gmail.com> <275aa2c2-ec39-1d52-1a48-1d990949fdb5@gmail.com> <1d3af678-6fa3-62ba-5d6b-b85bc182608e@gmail.com> <87eeoh1eba.fsf@gnus.org> X-Now-Playing: Dead Can Dance's _Spleen and Ideal_: "Circumradiant Dawn" Date: Tue, 18 Aug 2020 16:07:10 +0200 In-Reply-To: <87eeoh1eba.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sat, 08 Aug 2020 15:02:01 +0200") Message-ID: <87h7t0kpyp.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Lars Ingebrigtsen writes: > =?UTF-8?Q?Cl=C3=A9ment?= Pit-Claudel writes: > >> Is there anything else I should do before pushing this patch? > > This was four months ago, so I guess you should go ahead and push the > pa [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Lars Ingebrigtsen writes: > Cl=C3=A9ment Pit-Claudel writes: > >> Is there anything else I should do before pushing this patch? > > This was four months ago, so I guess you should go ahead and push the > patch. That was a week ago, so I went ahead and pushed the patch to Emacs 28. --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 18 10:07:30 2020 Received: (at control) by debbugs.gnu.org; 18 Aug 2020 14:07:30 +0000 Received: from localhost ([127.0.0.1]:36555 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k82Gw-0001vB-6h for submit@debbugs.gnu.org; Tue, 18 Aug 2020 10:07:30 -0400 Received: from quimby.gnus.org ([95.216.78.240]:33100) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k82Gu-0001uf-J9 for control@debbugs.gnu.org; Tue, 18 Aug 2020 10:07:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=J5i2cppOAqy5iBB0xiis//Uj3cmpUOHDibMgieJo+oo=; b=AV+If3f/sVuiWR2yqq5oMfFhm+ 6+cH8iMJHyXEPuKHxN4t1dsjD/SvztXCsWparhBD63JtgTt2DqwuSt1vpQ1hULkNbpTqPsvLRuJq2 nwvh0NlatEfmUYTefaAl2fVhK+8CkCd2JnDJww8oRlc3v2tp5iYL8N6dW/w4isZn1lS8=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k82Gm-0007g8-UV for control@debbugs.gnu.org; Tue, 18 Aug 2020 16:07:23 +0200 Date: Tue, 18 Aug 2020 16:07:19 +0200 Message-Id: <87ft8kkpyg.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #40562 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 40562 fixed close 40562 28.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 40562 fixed close 40562 28.1 quit