Greetings.

I've run into a situation which (I think) is the Clojure analogue of 
<http://stackoverflow.com/questions/5672778/class-getmethod-when-parameter-is-varargs>,
 and I'm not sure how to apply the solution there to Clojure (I'm a Clojure 
beginner, though familiar with Java and with various Schemes).

That is, I want to call a Java method with varargs and , if I'm understanding 
my problem correctly, (a) I can't do so straightforwardly using '.' in Clojure, 
and (b) I can't work out how to call .getMethod correctly.

Using the stackoverflow problem as an example, it seems that I can't do 

 (.queryForObject jdbcTemplate rowMapper)

nor can I do

 (let [m (.getMethod SimpleJdbcTemplate
            "queryForObject"
            (into-array [RowMapper])]
   (.invoke m jdbcTemplace (to-array [rowMapper])))

but need instead to do something like

 (let [m (.getMethod SimpleJdbcTemplate 
            "queryForObject" 
            (into-array [RowMapper (class-of-array-of Object)])]
   (.invoke m jdbcTemplace (to-array [rowMapper])))

Have I understood this correctly, and if so, what is the magic incantation for 
the last case?

Thanks for any pointers.

Best wishes,

Norman


-- 
Norman Gray  :  http://nxg.me.uk
SUPA School of Physics and Astronomy, University of Glasgow, UK

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