Re: Suitable values as weak keys
Daphne Preston-Kendal 22 Sep 2024 10:07 UTC
On 18 Sep 2024, at 17:25, Marc Nieper-Wißkirchen <xxxxxx@gmail.com> wrote:
> And the text reflects this by saying that the keys should have locations. This means that you won't see a catastrophic failure, but you have to know what you do (and your implementation of SRFI 254).
>
>> I think it is probably a bad idea, because what has location and what
>> does not is implementation-dependent – beyond matters which, in R6 and
>
> It is partially implementation-dependent, which is an important distinction. The RnRS define a lot of value types that have locations.
In order words, it is implementation-dependent.
Writing portable code that uses SRFI 254 will be a nightmare if it is not possible to pass any given object into an ephemeron or guardian.
I would maybe accept a restriction on passing some very minimal set of types as keys to an ephemeron: #t, #f, '().
Anything else might have location in a given implementation.
(We mustn’t forget that R7-small implementations with no fixnums, i.e. where all numbers are boxed like in CPython, may also want to support SRFI 254.)
Daphne