[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#40562: [patch] Treat records as arrays in ert object comparisons and
From: |
Štěpán Němec |
Subject: |
bug#40562: [patch] Treat records as arrays in ert object comparisons and add support for cl-structs |
Date: |
Sun, 12 Apr 2020 11:24:41 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
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. 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).
--
Štěpán