On 27 Jan 2010, at 14:52, Jules wrote:
I have a requirement to pull unknown Java classes out of an Object,
construct instances of them and plug these back into other
Objects...efficiently...
I had a similar problem recently and Rich proposed the following
solution, which works fine for me:
Since Clojure already does this, you can borrow its implementation,
found in clojure.lang.Reflector. In this case, see invokeConstructor.
(clojure.lang.Reflector/invokeConstructor (class (ref "foo")) (to-
array [42]))
=> #<r...@6ad3c65d: 42>
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