bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#56255: 28.1.50; sxhash-equal does not change when object is modified


From: Lars Ingebrigtsen
Subject: bug#56255: 28.1.50; sxhash-equal does not change when object is modified
Date: Tue, 28 Jun 2022 01:00:33 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Lars Ingebrigtsen <larsi@gnus.org> writes:

> So I think the doc string overstates things. 
>
> --
> If (equal A B), then (= (sxhash-equal A) (sxhash-equal B)).
> --
>
> Is not remotely true, but:
>
> --
> If (= (sxhash-equal A) (sxhash-equal B)) then it's quite likely that
> (equal A B), but the opposite is not true for deeply nested structures.
> --

Sorry, that's all wrong, and what the doc string says is true.  That is,
if they're equal, then the hash is =.

But (= (sxhash-equal A) (sxhash-equal B)) does not imply that
(equal A B), and the doc string should say that explicitly.

It's the manual that's wrong here:

     If the two objects are not ‘equal’, the values returned by
     ‘sxhash-equal’ are usually different, but not always; once in a
     rare while, by luck, you will encounter two distinct-looking
     objects that give the same result from ‘sxhash-equal’.

It's not "once in a rare while" for deeply nested structures.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

[Prev in Thread] Current Thread [Next in Thread]