Sounds like type-classes from haskell/scala? Or is that a different thing?
Hopefully that helps.. Sorry if it's not exactly helpful
The protocol example at the end shows how it's done
https://eli.thegreenplace.net/2016/the-expression-problem-an...
If you write something like
(extend-type BinaryPlus
Evaluatable
(evaluate [this] (+ (evaluate (:lhs this)) (evaluate (:rhs this)))))
Then you are adding (and defining) the Evaluatable interface to a record BinaryPlus (which can be coming from a different library and already be implementing other interfaces)BinaryPlus records can still be used where they were used previously, but you can also use them with the enhancement you added
> I get the impression you'd need to explicitly create a new type class?
In the same way you need to use defprotocol in Clojure. You can implement existing type classes on types without defining a new type class.