emacs-devel
[Top][All Lists]
Advanced

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

Re: master 724af76 2/2: Fix sxhash-equal on bytecodes, markers, etc.


From: Paul Eggert
Subject: Re: master 724af76 2/2: Fix sxhash-equal on bytecodes, markers, etc.
Date: Tue, 7 Jan 2020 12:19:56 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1

On 1/7/20 11:36 AM, Pip Cet wrote:

I don't think there's any reason for using markers as keys in
an equal-based hash table. But if you do, what you probably meant was
to use an eq-based hash table, and that used to work; now it doesn't.

(puthash marker value ht)
<...move marker...>
(gethash marker ht)

won't work.


In what sense doesn't it work? The following code still works, anyway:

  (with-temp-buffer
    (insert "a")
    (let ((marker (point-marker))
          (ht (make-hash-table :test 'eq))
          (value 27))
      (puthash marker value ht)
      (set-marker marker 0)
      (gethash marker ht)))

It's true that if we change 'eq to 'equal in this example, gethash now returns nil where it used to return t. But that's the same thing that would happen if one modifies a string key in a equal-based hash table. So I don't see the problem.



reply via email to

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