Re: Perpetuity of non-generative record type definitions
Daphne Preston-Kendal 02 Nov 2022 10:28 UTC
On 2 Nov 2022, at 11:18, Marc Feeley (via srfi-237 list) <xxxxxx@srfi.schemers.org> wrote:
> I think this (the “must” detect the redefinition) would be too big of a burden on the implementation. It is not even clear what scope the registry must have (I would think it needs to be at the same level as a library registry because some other programmer may be redefinining the record type with no prior compilation of the original record type).
It also prevents two distinct libraries from internally using two different implementations of the same record (i.e. data structure) within the same program, even if those implementations never directly interact.
> In any case, there is a simpler approach, namely to create a hash of the relevant parts of the record definition and to combine this hash with the UID. That way, if the number of fields, the name of the fields, the UID, etc change then the type will effectively be a different type.
I think this makes more sense than having a UID at all, but I’ve given up arguing against the design decisions in the R6RS record library.
Daphne
(apologies to Marc who gets this mail twice because I forgot to reply-all)