user=> (defprotocol Area (get-area [this]))
Area
user=> (defrecord Rectangle [width height]
Area
(get-area [this]
(* width height)))
user.Rectangle
(extends? Area Rectangle)
true
(defn extends?
"Returns true if atype extends protocol"
{:added "1.2"}
[protocol atype]
(boolean (or (implements? protocol atype)
(get (:impls protocol) atype))))
Comments top
No comments for extends?. Log in to add a comment.