Groups
Groups
Sign in
Groups
Groups
Clojure
Conversations
About
Send feedback
Help
Minor bug in int-array, long-array, float-array and double-array
1 view
Skip to first unread message
Frantisek Sodomka
unread,
May 18, 2009, 4:34:01 PM
5/18/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Clojure
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[] [I@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
Frantisek Sodomka
unread,
May 18, 2009, 4:37:39 PM
5/18/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Clojure
Sorry, forgot to mention: Found when testing Clojure 1.0.0.
Frantisek
Reply all
Reply to author
Forward
0 new messages