store/[org.clojure/clojure "1.8.0"] clj::clojure.core/short-array

Official Documentation

Add notes
Arities
==================================================
   [size-or-seq]
   [size init-val-or-seq]

Docstring
==================================================
  Creates an array of shorts

Source

(defn short-array
  "Creates an array of shorts"
  {:inline (fn [& args] `(. clojure.lang.Numbers short_array ~@args))
   :inline-arities #{1 2}
   :added "1.1"}
  ([size-or-seq] (. clojure.lang.Numbers short_array size-or-seq))
  ([size init-val-or-seq] (. clojure.lang.Numbers short_array size init-val-or-seq)))

Example 1

Edit
;; create an array of shorts using short-array
;; and demonstrate how it can be used with the java Arrays functions
;; (note the needed coercions)

(def ss (short-array (map short (range 3 10))))
;; => #'user/ss

(type ss)
;; => [S

(vec ss)
;; => [3 4 5 6 7 8 9]

(java.util.Arrays/binarySearch ss (short 6))
;; => 3

(java.util.Arrays/fill ss (short 99))
;; => nil

(vec ss)
;; => [99 99 99 99 99 99 99]

Uses on crossclj