Every class object has a newInstance method:

user=> (Class/forName "java.util.HashMap")
java.util.HashMap
user=> (.newInstance (Class/forName "java.util.HashMap"))
#<HashMap {}>
user=>

Is that what you are looking for?

On Jan 11, 4:03 pm, Konrad Hinsen <konrad.hin...@fastmail.net> wrote:
> Is there a way to create a new object by calling its java constructor  
> given just the class object? The new form doesn't do the job, as it  
> requires a symbol naming the class. But I can't find anything else on  
> the Java interop page... Is this impossible?
>
> Konrad.
-- 
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