1.3.0 permalink 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:3600 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"
   :static true}
  [s & vals]
    (. clojure.lang.PersistentStructMap (construct s vals)))
Vars in clojure.core/struct:
Used in 0 other vars

Comments top

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