;; defprotocol is Clojure's interface: names and arities only,
;; never a body and never a field
(defprotocol Printable
(render [this]))
;; a protocol is not a constructor, there is nothing to instantiate:
;; (Printable.) ;; <- error, no such class
;; only a type may implement it
(defrecord Note [text]
Printable
(render [this] (str "<" text ">")))
(println "rendered is" (render (->Note "hello")))