JiSE
JiSE copied to clipboard
Inheritance example with Abstract classes
One problem that I've always faced with clojure is that it's not possible to derive things from Abstract classes.
https://stackoverflow.com/questions/53090419/clojure-proxy-implementing-abstract-class-with-protected-constructor
Can you create an example showing how to do it with JiSE?
I will prepare some documentation on the JiSE syntax in the future, but shortly: You can use the optional "inheritance vector" syntax to specify the parent class and/or implemented interfaces.
For example, if you want to define a class that is derived from the class P
and implements the interfaces I1
and I2
, you can write something like the following:
(require '[jise.core :refer [defclass]])
(defclass C [P I1 I2] ...)
This is an example that I ran into trouble porting
https://github.com/orbit-legacy/orbit1
Another thing that is difficult is with annotations. I think orbit uses them well but it's not that well supported with clojure.
https://picocli.info/#_options_and_parameters
Another interesting use case might be this:
http://teavm.org/docs/runtime/metaprogramming.html
This would be another project that'd be great to get working:
https://github.com/bytedeco/javacpp