Fork me on GitHub
#clerk
<
2023-11-03
>
teodorlu07:11:59

Good morning! If I want my own deftype to play nicely with clerk, should I implement valuehash.impl/CanonicalByteArray on it? https://github.com/arachne-framework/valuehash/blob/ff1d4b7f1260daf41c786a61cb45d02871b7baf9/src/valuehash/impl.clj#L5

mkvlr08:11:16

good morning, we’re using a valuehash based on nippy

👍 1
mkvlr08:11:09

you’ll proobably want to add it to nippy‘s freeze-serializable-allowlist

👍 1
mkvlr08:11:30

(this should be in earmuffs, not bold)

👍 1
mkvlr08:11:32

you should first try if nextjournal.clerk.analyzer/valuehash returns a non-deterministic value for your custom object

💯 1
teodorlu11:11:09

Awesome, I'll start there. Thank you!

teodorlu12:11:10

I checked that nextjournal.clerk.analyser/valuehash gave me the same hash each time I wanted the same type, and put my type into *freeze-serializable-allowlist*. That appears to have solved all my problems. Thanks again!

mkvlr12:11:43

great to hear!