I want to implement transient and persistent! in my Clojure deftype. As far as I can tell, this means that you need to use another method, TransientMyThing, to implement the necessary methods. Well, so far these two classes need to know about each other in order to return to each other.
I think I can do this by reselling Clojure's make-transient and make-persistent functions, then defining deftype (referring to this function), then implementing functions with already existing types, but this seems pretty rude to me. Is there a better option?
Edit: this works, but still rude.
source share