Hello,

Le vendredi 11 avril 2025 à 09:49 -0400, Olivier Dion a écrit :
> But some fields seems to
> not be taken into account and you will end up with fetching
> substitute
> in the store.  I want to avoid this element of surprise in my case.

>From what I understand, here (problem A), you want to avoid a hash
collision (two different codes hashing to the same value)…

> Like mentioned in the comment (look for the `(procedure? value)'
> clause), this does _not_ yield the same hash for a procedure if the
> module where this procedure came from is compiled.

And here (problem B), you want to avoid having equivalent code (source
vs bytecode) hashing to different values.

Did I summarize it correctly?

Solving A is easy: generate a new unique identifier each time you hash
any functional value (or refuse to cache the result).

I don’t have an answer for B, but others may.

However, considering problem B, it may be more complex than just source
and bytecode. What if the GOOPS object creator uses different
dependencies, but they turn out to have the same behavior? I’m thinking
about a non-free/free replacement situation. Since the object creator
has a clearer vision of the functions and dependencies they use, maybe
you could ask them to provide a version number of their relevant
functional code, and hash this version number instead?

Best regards,

Vivien

Reply via email to