cfunction
src/core/corelib.c on line 403 , column 1
(array & items )
Create a new array that contains items. Returns the new array.
(def arr (array :a [:b :c ] :d ))
# => @[:a (:b :c) :d]
(0 arr )
# => :a
(1 arr )
# => (:b :c)
# out-of-bounds access causes an error
(try
(3 arr )
([err ] err ))
# => "expected integer key for array in range [0, 3), got 3"
# you may use `get` to avoid the error
(get arr 3 )
# => nil
(array 1 2.3 :a "foo" true nil [] {} (fn []))
# => @[1 2.3 :a "foo" true nil () {} <function 0x7FB2A3F02170>]
@[1 2 3] # -> @[1 2 3]
(array 1 2 3) # -> @[1 2 3]
(array (splice [1 2 3]) # -> @[1 2 3]
(array ;[1 2 3]) # -> @[1 2 3]