On Wed, May 18, 2011 at 10:40 AM, Jonathan Fischer Friberg
<odysso...@gmail.com> wrote:
> If I'm not mistaken, you should NOT use extend-type to extend java classes
> (only interfaces and protocols).
>
> To answer your questions, you can "extend" a class and interfaces with
> proxy, like so:
>
> (proxy [classA interfaceA interfaceB] [] ...)

Which doesn't help jlk much, since he was wanting to extend String and:

=> (proxy [String] [])
#<CompilerException java.lang.VerifyError: Cannot inherit from final
class (NO_SOURCE_FILE:0)>

The JVM won't allow that. He'll need to find some workaround, probably
involving extending CharSequence instead of String.

-- 
Protege: What is this seething mass of parentheses?!
Master: Your father's Lisp REPL. This is the language of a true
hacker. Not as clumsy or random as C++; a language for a more
civilized age.

-- 
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

Reply via email to