(define-proto-implementations type-obj type-name & record-implementations)(define-record-like-print-methods type-name)(defnt fn-name & rest-of-body)(defp protocol-name & opts+sigs)Define a (defp) protocol, which is essentially just a list of multimethods.
It uses the same syntax as defprotocol, e.g.
(defp Shape (area [this]))
[protocol-name keyword-options? & method-signatures] protocol-name: The name of the protocol keyword-options: Named arguments, so far this is only :external-methods -- a list of methods in this protocol where 'defmulti' is defined elsewhere. :extends -- a list of protocols that this protocol extends. This creates a union of all methods defined here and in the parent protocol method-signatures -- the actual methods to implement. for everything here, define a new 'defmulti' dispatching on type and then attach it to this protocol
Define a (defp) protocol, which is essentially just a list of multimethods.
It uses the same syntax as defprotocol, e.g.
(defp Shape
(area [this]))
[protocol-name keyword-options? & method-signatures]
protocol-name: The name of the protocol
keyword-options: Named arguments, so far this is only
:external-methods -- a list of methods in this protocol where 'defmulti' is defined elsewhere.
:extends -- a list of protocols that this protocol extends. This creates a union of all methods defined here
and in the parent protocol
method-signatures -- the actual methods to implement. for everything here, define a new 'defmulti' dispatching on type
and then attach it to this protocol
(deft class-name inp-fields-list & record-implementations)(get-method-impl-name interface-name impl env)(get-method-impl-name-clj interface-name impl)(get-method-impl-name-cljs interface-name impl env)(witht def-list & code)cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |