;; create an array of Java boolean's using boolean-array ;; and demonstrate that it can be used for input into the standard ;; Java Arrays.fill function user=> (def bs (boolean-array (map even? (range 3 10)))) #'user/bs user=> (type bs) [Z user=> (vec bs) [false true false true false true false] user=> (java.util.Arrays/fill bs 3 7 false) nil user=> (vec bs) [false true false false false false false] user=>
(defn boolean-array
"Creates an array of booleans"
{:inline (fn [& args] `(. clojure.lang.Numbers boolean_array ~@args))
:inline-arities #{1 2}
:added "1.1"}
([size-or-seq] (. clojure.lang.Numbers boolean_array size-or-seq))
([size init-val-or-seq] (. clojure.lang.Numbers boolean_array size init-val-or-seq)))
Comments top
No comments for boolean-array. Log in to add a comment.