In the documentation of Clojure's type mechanisms, it is stated that
- Concrete derivation is bad
- you cannot derive datatypes from concrete classes, only interfaces
However, some of the core Clojure classes use concrete derivation (there are other examples, but these are the only cases in which the superclass is part of clojure.lang
):
ARef
extendsAReference
Agent
extendsARef
Atom
extendsARef
Namespace
extendsAReference
Ref
extendsARef
Var
extendsARef
In addition, there are many abstract classes. However, there is no way to create the equivalent of an abstract class in Clojure, and to me, extension of an abstract class seems to have all the same drawbacks as regular concrete derivation.
Why is concrete derivation used here?