๐Ad hoc hierarchy system
Clojure has an ad hoc hierarchy system. You can define a relationship between any two objects using derive
function:
(derive ::rect ::shape)
(derive ::square ::rect)
(derive java.util.Map ::collection)
parents
, ancestors
, descendants
, isa?
and ยง Multiple dispatch in Clojure work with this hierarchy.
Next
This might be the simplest form of nominal subtyping.