(double-array [1.2 2.2]) doubles just cast object into a double array, which fails if the object is not already one. It does not convert arbitrary array into array of doubles. doubles is used in few cases, when you need to pass array of doubles instead of just Object (or to get rid of reflection/to improve performance of some loop which uses double array)
Jozef On Sun, Mar 9, 2014 at 3:23 PM, ru <soro...@oogis.ru> wrote: > (doubles (into-array [1.2 2.2])) > #<ClassCastException java.lang.ClassCastException: [Ljava.lang.Double; > cannot be cast to [D> > > ??? > > -- > 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 > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.