1.3.0 permalink Arrow_down_16x16



  • (boolean-array size-or-seq)
  • (boolean-array size init-val-or-seq)
Creates an array of booleans

1 Example top

  • ;; 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=> (type bs)
    user=> (vec bs)
    [false true false true false true false]
    user=> (java.util.Arrays/fill bs 3 7 false)
    user=> (vec bs)
    [false true false false false false false]
Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/core.clj:4602 top

(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)))
Vars in clojure.core/boolean-array:
Used in 0 other vars

Comments top

No comments for boolean-array. Log in to add a comment.