> I guess I'm still stuck on how to expand the vector of arguments in place...
One way is (apply function vector) -> (function v1 v2 v3)
> and I'm really not very sure what you're doing with the '&' in the
> parameters for the str-invoke. Is that a way of slurping all the remaining
> parameters into a vector? If so, then aren't I needing to do the opposite?
Yup precisely :)
> I tried removing the &, and into-array - that didn't work.
Close! Just removing & but leave into-array is what you want.
(defn str-invoke [instance method-str args]
(clojure.lang.Reflector/invokeInstanceMethod
instance method-str (to-array args)))
user=> (str-invoke i m args)
"m"
So in summary you can either use apply or remove the &
Regards,
Tim.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---