It looks that there is a bug in int-array, long-array, float-array and
double-array when creating an array using an empty sequence.

Doc:
clojure.core/int-array
([size-or-seq] [size init-val-or-seq])
  Creates an array of ints

This works:
user=> (int-array 0)
#<int[] [...@11978b>
user=> (vec (int-array 0))
[]
user=> (alength (int-array 0))
0

This throws NPE:
user=> (int-array [])
java.lang.NullPointerException (NO_SOURCE_FILE:0)
user=> (long-array [])
java.lang.NullPointerException (NO_SOURCE_FILE:0)
user=> (float-array [])
java.lang.NullPointerException (NO_SOURCE_FILE:0)
user=> (double-array [])
java.lang.NullPointerException (NO_SOURCE_FILE:0)

All other possible combinations seem to work.

Thank you, Frantisek
--~--~---------~--~----~------------~-------~--~----~
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
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