On Wed, Aug 18, 2021 at 01:09:47PM +0000, Ed Avis wrote: > I have asked before whether references could always be preserved in hash > keys Just a general observation here about proposals to change or improve hash semantics. I've been meaning for many years (but lacked tuits) to introduce hash vtables, which would allow for differing hash implementations to be called on a per-hash basis (so you could declare a hash as being of a key-order-preserving or ref-as-key-preserving type for example). Implementing this would then allow proposals such as yours to implemented as optional extras without risking breaking backwards compatibility or internals efficiency. I even reserved a flag bit for it: #define SVf_FAKE 0x01000000 /* ... 3: HV: informally reserved by DAPM for vtables Having such a mechanism would also allow us to remove all the special-cased code in hv.c for %ENV, tied etc. -- "There's something wrong with our bloody ships today, Chatfield." -- Admiral Beatty at the Battle of Jutland, 31st May 1916.Thread Previous | Thread Next