>
> (assoc [3 4 5] 2 :a)
>
> => [3 4 :a]
>
> (assoc [3 4 5 3 :kdf1] 2 :a)
>
> => [3 4 :a 3 :kdf1]
>
> thank you.
--
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
Vector keys must be integers. Try
(assoc [] 0 :a)
A vector has keys from 0 to (count vector) pointing to elements at the same
index. It's more like an Array list in this way.
What you're doing would need a map instead. Try
(assoc {} :a 0)
--
You received this message because you are subscrib
This exception tip is a bit confusing.
(assoc [] :a 3)
>
>
> IllegalArgumentException Key must be integer
> clojure.lang.APersistentVector.assoc (APersistentVector.java:347)
>
>
--
You received this message because you are subscribed to the Google
Groups "Clojure&