Update primitive? to be a function

This commit is contained in:
Joshua Suskalo 2022-01-18 14:00:13 -06:00
parent 634f371144
commit 6ba905e6bf

View file

@ -518,11 +518,16 @@
(sequential? type) (keyword (first type))
:else (throw (ex-info "Invalid type object" {:type type}))))
(def primitive?
(def primitive-types
"A set of all primitive types."
#{::byte ::short ::int ::long ::long-long
::char ::float ::double ::pointer})
(defn primitive?
"A predicate to determine if a given type is primitive."
[type]
(contains? primitive-types (type-dispatch type)))
(defmulti primitive-type
"Gets the primitive type that is used to pass as an argument for the `type`.