object-array

clojure.core

  • (object-array size-or-seq)
Creates an array of objects

1 Example top

  • ;; create an array of Java Objects using object-array
    ;; and demonstrate that it can be used with the Java fill function
    
    user=> (def os (object-array [nil 23.2 "abc" 33]))
    #'user/os
    user=> (vec os)
    [nil 23.2 "abc" 33]
    user=> (java.util.Arrays/fill os 31415)
    nil
    user=> (vec os)
    [31415 31415 31415 31415]
    user=>
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:4642 top

(defn object-array
  "Creates an array of objects"
  {:inline (fn [arg] `(. clojure.lang.RT object_array ~arg))
   :inline-arities #{1}
   :added "1.2"}
  ([size-or-seq] (. clojure.lang.RT object_array size-or-seq)))
Vars in clojure.core/object-array:
Used in 0 other vars

Comments top

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