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

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

bug#43397: 28.0.50; Adding tool bar items: update tool bar


From: Stefan Monnier
Subject: bug#43397: 28.0.50; Adding tool bar items: update tool bar
Date: Tue, 03 May 2022 13:53:21 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Lars Ingebrigtsen [2022-05-03 18:39:51] wrote:
> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> `tool-bar-map` is a normal keymap, which we modify in the usual way,
>> i.e. via side-effect.  So the key we place in this `equal` hash table
>> will be routinely modified via side-effect, thus changing its sxhash.
> Hm...  I assumed that that was the point, really, but that it didn't
> work for...  reasons...  I.e., whenever somebody modifies the map, the
> cache is supposed to be refreshed.  I don't understand why that didn't
> work, but it doesn't.

Since the key is stored as-is in the hash table, modifying the key and
looking it up again should find it its hash value is unchanged, and the
`equal` test will return t since both the in-hashtable key and the
lookup-key are one and the same object.

In any case side effects on a key's stored in an `equal` hash table lead
in general to the hash table having an inconsistent internal state, so
they should be avoided as much as possible.

[ Just like using `aset` on the `symbol-name` of an interned symbol,
  for the same reason.  ]


        Stefan






reply via email to

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