On Saturday, 5 April 2014 08:08:13 UTC+8, Colin Fleming wrote:
>
> FWIW, in Cursive, which is a big ball of mixed Clojure + Java, I've given 
> up trying to use gen-class and have started using Java shims for 
> everything. I like it a lot more than gen-class, which I always feel like 
> I'm fighting. With the new Java->Clojure API in 1.6 (or the equivalent 
> using RT.var() and friends for earlier versions) it's really not that hard, 
> tool support is much better and IMO it's much cleaner. gen-class will 
> always indirect method calls through a var but if you're worried about 
> performance you can get the underlying function object with Java and call 
> it directly, with the caveat that you then lose the ability to update it 
> dynamically at the REPL.
>
> I'd dearly love a deftype-style extend-type or similar which would allow 
> base class extension. I know it's not encouraged in Clojure but one of 
> Clojure's fundamental principles is exposing the host where it's pragmatic 
> to do so, and both proxy and gen-class have some pretty serious warts for 
> this purpose.
>

+LOTS for this. I have wanted to extend a Java abstract base class *many* 
times in Clojure. It's a real pain point, right now. Especially for interop 
with Java libraries that expect you to extend base classes in order to 
write plugins etc. Currently when this comes up I just forget about Clojure 
and write this stuff in Java.

IMHO extending reify to support abstract base classes as well as interfaces 
would be the simplest way to achieve this.

FWIW here's the (as yet unaddressed) issue I raised about this on 
JIRA: http://dev.clojure.org/jira/browse/CLJ-1255

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to