Liking cljdoc? Tell your friends :D

hara.core


implements?clj

(implements? {:keys [impls] :as protocol} type)
(implements? protocol type method)

checks whether a type has implemented a protocol

(implements? state/IStateGet clojure.lang.Atom) => true

(implements? state/IStateGet clojure.lang.Atom "-get-state") => true

checks whether a type has implemented a protocol

(implements? state/IStateGet clojure.lang.Atom)
=> true

(implements? state/IStateGet
             clojure.lang.Atom
             "-get-state")
=> true
raw docstring

protocol-implsclj

(protocol-impls protocol)

returns types that implement the protocol

(protocol-impls state/IStateSet) => (contains [clojure.lang.Agent clojure.lang.Ref clojure.lang.IAtom clojure.lang.Volatile clojure.lang.IPending clojure.lang.Var] :in-any-order :gaps-ok)

(protocol-impls state/IStateGet) => (contains [clojure.lang.IDeref clojure.lang.IPending] :in-any-order :gaps-ok)

returns types that implement the protocol

(protocol-impls state/IStateSet)
=> (contains [clojure.lang.Agent
              clojure.lang.Ref
              clojure.lang.IAtom
              clojure.lang.Volatile
              clojure.lang.IPending
              clojure.lang.Var]
             :in-any-order :gaps-ok)

(protocol-impls state/IStateGet)
=> (contains [clojure.lang.IDeref clojure.lang.IPending]
             :in-any-order :gaps-ok)
raw docstring

protocol-interfaceclj

(protocol-interface protocol)

returns the java interface for a given protocol

(protocol-interface state/IStateGet) => hara.protocol.state.IStateGet

returns the java interface for a given protocol

(protocol-interface state/IStateGet)
=> hara.protocol.state.IStateGet
raw docstring

protocol-methodsclj

(protocol-methods protocol)

returns the methods provided by the protocol

(protocol-methods state/IStateSet) => '[-clone-state -empty-state -set-state -update-state]

returns the methods provided by the protocol

(protocol-methods state/IStateSet)
=> '[-clone-state -empty-state -set-state -update-state]
raw docstring

protocol-removeclj

(protocol-remove protocol atype)

removes a protocol

(defprotocol -A- (-dostuff [_]))

(do (extend-protocol -A- String (-dostuff [_]))

 (implements? -A- String "-dostuff"))

=> true

(do (protocol-remove -A- String) (implements? -A- String "-dostuff")) => false

removes a protocol

(defprotocol -A-
  (-dostuff [_]))

(do (extend-protocol -A-
      String
      (-dostuff [_]))
    
     (implements? -A- String "-dostuff"))
=> true

(do (protocol-remove -A- String)
    (implements? -A- String "-dostuff"))
=> false
raw docstring

protocol-signaturesclj

(protocol-signatures protocol)

returns the method signatures provided by the protocol

(protocol-signatures state/IStateSet) => '{-update-state {:arglists ([obj f args opts]) :doc nil} -set-state {:arglists ([obj v opts]) :doc nil} -empty-state {:arglists ([obj opts]) :doc nil} -clone-state {:arglists ([obj opts]) :doc nil}}

returns the method signatures provided by the protocol

(protocol-signatures state/IStateSet)
=> '{-update-state  {:arglists ([obj f args opts]) :doc nil}
     -set-state     {:arglists ([obj v opts]) :doc nil}
     -empty-state   {:arglists ([obj opts])   :doc nil}
     -clone-state   {:arglists ([obj opts])   :doc nil}}
raw docstring

protocol?clj

(protocol? obj)

checks whether an object is a protocol

(protocol? state/IStateGet) => true

checks whether an object is a protocol

(protocol? state/IStateGet)
=> true
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close