0

I am newbie with clojure language and I am questioning if it is possible make a class hierarchy in this language, namely, create an abstract or interface class and then make class that extends or implements firstly class .

Thanks for your attention.

Regards

  • 1
    For implementing interfaces, see [protocols](https://clojure.org/reference/protocols). For a true class hierarchy, see [multimethods](https://clojure.org/reference/multimethods). For a comparison, see [here](https://stackoverflow.com/questions/8070368/clojure-multimethods-vs-protocols#8074581). – Thumbnail Feb 10 '18 at 12:26
  • 1
    just curious why you would want to use clojure and extend class hierarchies? this is very unusual in clojure and typically ill advised, even if possible – David Meister Feb 10 '18 at 12:39
  • 1
    Since everything is better with a car comparison: this is as if asking, upon switching to an electric car, how to change gears. Electric cars don't have nor need gears. – Svante Feb 10 '18 at 23:11
  • Well I am working with Clojure through Grafter for Linked Data generation. The point is that I have 3 classes with same methods and functionality. In JAVA in this case you have to use hierarchy but I'm not sure the procedure in Clojure. – Mishel Uchuari Feb 15 '18 at 09:34

0 Answers0