ClojureDocs

Nav

Namespaces

aclone

clojure.core

Available since 1.0 (source)
  • (aclone array)
Returns a clone of the Java array. Works on arrays of known
types.
1 Example
;; create an Java integer array, then clone it
;; note that when you modify b, a remains the same
;; showing that b is not just a reference to a
user=> (def a (int-array [1 2 3 4]))
#'user/a

user=> (def b (aclone a))
#'user/b

user=> (aset b 0 23)
23

user=> (vec b)
[23 2 3 4]

user=> (vec a)
[1 2 3 4]
See Also

Returns the value at the index/indices. Works on Java arrays of all types.

Added by mmwaikar

Creates an array of ints

Added by phreed
0 Notes
No notes for aclone