Re: Strange behaviour for proxy when two abstract classes are passed in
On Monday, March 31, 2014 4:34:17 PM UTC-5, zcaudate wrote: I know this is a silly example but I am curious to know what is happening with the proxy method. I have set up two calls to proxy: 1. (def cp (proxy [java.util.AbstractMap clojure.asm.ClassVisitor] [])) 2. (def cp (proxy [clojure.asm.ClassVisitor java.util.AbstractMap] [])) The first call is fine and it return cp. The second call gives me an exception. You cross-posted to Stack Overflow Stack Overflowhttp://stackoverflow.com/q/22779892/1756702. Copy of my answer there: Neither will work in Clojure 1.6.0. In 1.5, `clojure.asm.ClassVisitor` was an interface instead of an abstract class. Proxy expects at most one class followed by optional interfaces. As `java.util.AbstractMap` is an abstract class, it cannot appear second in the list of class-and-interfaces. -- 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.
Re: Strange behaviour for proxy when two abstract classes are passed in
Ah no wonder! I was looking at the wrong documentation for asm. On 02/04/2014, at 1:41, A. Webb a.webb@gmail.com wrote: On Monday, March 31, 2014 4:34:17 PM UTC-5, zcaudate wrote: I know this is a silly example but I am curious to know what is happening with the proxy method. I have set up two calls to proxy: 1. (def cp (proxy [java.util.AbstractMap clojure.asm.ClassVisitor] [])) 2. (def cp (proxy [clojure.asm.ClassVisitor java.util.AbstractMap] [])) The first call is fine and it return cp. The second call gives me an exception. You cross-posted to Stack Overflow Stack Overflow. Copy of my answer there: Neither will work in Clojure 1.6.0. In 1.5, `clojure.asm.ClassVisitor` was an interface instead of an abstract class. Proxy expects at most one class followed by optional interfaces. As `java.util.AbstractMap` is an abstract class, it cannot appear second in the list of class-and-interfaces. -- 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 a topic in the Google Groups Clojure group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojure/xInFQ7hCf0c/unsubscribe. To unsubscribe from this group and all its topics, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- 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.
Strange behaviour for proxy when two abstract classes are passed in
I know this is a silly example but I am curious to know what is happening with the proxy method. I have set up two calls to proxy: 1. (def cp (proxy [java.util.AbstractMap clojure.asm.ClassVisitor] [])) 2. (def cp (proxy [clojure.asm.ClassVisitor java.util.AbstractMap] [])) The first call is fine and it return cp. The second call gives me an exception. clojure.lang.Compiler$CompilerException: java.lang.IncompatibleClassChangeError: Implementing class, compiling:(/private/var/folders/dd/qfdy6sbn3mlgk20vcxc3j0ljnpxsqr/T/form-init4780219965491827451.clj:2:5) java.lang.IncompatibleClassChangeError: Implementing class java.lang.ClassLoader.defineClass1 ClassLoader.java java.lang.ClassLoader.defineClass ClassLoader.java: 800 java.lang.ClassLoader.defineClass ClassLoader.java: 643 clojure.lang.DynamicClassLoader.defineClass DynamicClassLoader.java: 46 clojure.core/get-proxy-class core_proxy.clj: 262 -- 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.