Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inheritance example with Abstract classes #5

Open
zcaudate opened this issue Jun 23, 2020 · 4 comments
Open

Inheritance example with Abstract classes #5

zcaudate opened this issue Jun 23, 2020 · 4 comments

Comments

@zcaudate
Copy link

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?

@athos
Copy link
Owner

athos commented Jun 23, 2020

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] ...)

@zcaudate
Copy link
Author

zcaudate commented Jun 23, 2020

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

@zcaudate
Copy link
Author

Another interesting use case might be this:

http://teavm.org/docs/runtime/metaprogramming.html

@zcaudate
Copy link
Author

This would be another project that'd be great to get working:

https://github.com/bytedeco/javacpp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants