A struct constructor creates a map-like struct instance by assigning supplied values positionally to the keys in a struct definition. Define the keys with create-struct or defstruct, then call struct with the definition and values. section 11.1.4
Constructing a waypoint
(defstruct waypoint :type :lat :lon :id) (struct waypoint "VHF" "0.000000" "0.000000" "ABI") ;; {:type "VHF", :lat "0.000000", :lon "0.000000", :id "ABI"} For parsed rows, (apply struct waypoint values) turns each value sequence into a waypoint. Passing more values than defined keys raises IllegalArgumentException. section 11.1.4
Listing 11.4. → Constrained Map, Guarded keys
(create-struct [& keys]) (defstruct [name & keys]) (struct-map [s & inits]) (struct [s & vals]) (accessor [s key])
Use the compact API listing to compare struct with create-struct, defstruct, struct-map, and accessor. section 11.1.4
