You're passing one argument, a list contaning 3 elements, instead of 3 arguments. Try this (by the way, you can omit nth call):
(.SetOrigin cone (v 0) (v 2) (v 3)) Another option (not really relevant in this particular case) is to use memfn: (apply (memfn SetOrigin) cone [2 4 6]) суббота, 23 июня 2012 г., 15:33:23 UTC+6 пользователь Antonio Recio написал: > > I have an object called cone. I can change the origin of the cone with > this: > (.SetOrigin cone 1 1 1) > > I have a vector called v > (def v [2 4 6 8]) > > And I would like to take 3 elements of the vector v and to set to the > origin of the cone. But when I write this I obtain an error: > (.SetOrigin cone (list (nth v 0) (nth v 2)(nth v 3))) > ;=> #<ClassCastException java.lang.ClassCastException: Cannot cast > clojure.lang.PersistentList to [D> > > What I am doing wrong? > > -- 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