You're viewing version 1.2.0 of struct. The latest stable version of Clojure Core is 1.3.0.
1.2.0 Arrow_down_16x16

struct

clojure.core

  • (struct s & vals)
Returns a new structmap instance with the keys of the
structure-basis. vals must be supplied for basis keys in order -
where values are not supplied they will default to nil.

1 Example top

  • user> (defstruct mystruct :foo :bar)
    #'user/mystruct
    
    user> (struct mystruct "eggplant" "pizza")
    {:foo "eggplant", :bar "pizza"}
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:3130 top

(defn struct
  "Returns a new structmap instance with the keys of the
  structure-basis. vals must be supplied for basis keys in order -
  where values are not supplied they will default to nil."
  {:added "1.0"}
  [s & vals]
    (. clojure.lang.PersistentStructMap (construct s vals)))
Vars in clojure.core/struct: defn vals

Comments top

No comments for struct. Log in to add a comment.