Re: Suggestion: specify what value should be used when an ephemeron is used as a weak box Daphne Preston-Kendal (26 Sep 2024 18:20 UTC)

Re: Suggestion: specify what value should be used when an ephemeron is used as a weak box Daphne Preston-Kendal 26 Sep 2024 18:19 UTC

On 26 Sep 2024, at 20:10, Marc Nieper-Wißkirchen <xxxxxx@gmail.com> wrote:

> If we aim for maximal efficiency with regard to memory, we will have to add setters for ephemeron keys and values as well.  Otherwise, mutable data structures that make use of ephemerons may need an extra wrapper by a mutable pair, vector, or record.

Surely weak-referencing data structures will already have ephemerons in such a wrapper, so as to be able to collect them together somehow. When the value in a key is replaced, the Right Thing is for the data structure to make a new ephemeron and replace the old ephemeron entirely.

Daphne