Update primitive? to be a function
This commit is contained in:
parent
634f371144
commit
6ba905e6bf
1 changed files with 6 additions and 1 deletions
|
|
@ -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`.
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue