How do i allocate a vector with 1042 empty indexes?
Will the storage for it be lazily allocated?
like this
(def a (array-creation-function 1042))
(def b (assoc a 1041 42))
(b 1041)
--> 42
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It seems that vectors are not sparse so you must specify a value for each index when you create the vector. The easiest way seems to be to call (vec ) on a sequence.
These values are not created lazily it seems.