Liking cljdoc? Tell your friends :D

hara.module


extend-abstractcljmacro

(extend-abstract typesym protocolsyms & {:as options})

Creates a set of abstract multimethods as well as extends a set of protocols to a given type

(extend-abstract Envelope [IData] :select - :suffix -env :prefix nil :wrappers {-data (str "hello " %)} :dispatch :type :defaults {nil ([this & args] (Exception. "No input")) -data ([this] (:hello this))})

(data-env (map->Envelope {:hello "world"})) => "world"

(-data (map->Envelope {:hello "world"})) => "hello world"

Creates a set of abstract multimethods as well as extends a set of
protocols to a given type

(extend-abstract
 Envelope [IData]
 :select -
 :suffix -env
 :prefix nil
 :wrappers   {-data (str "hello " %)}
 :dispatch   :type
 :defaults   {nil   ([this & args] (Exception. "No input"))
              -data ([this] (:hello this))})

(data-env (map->Envelope {:hello "world"}))
=> "world"

(-data (map->Envelope {:hello "world"}))
=> "hello world"
raw docstring

extend-allcljmacro

(extend-all proto ptmpls & args)

Transforms a protocl template into multiple extend-type expresions

(macroexpand-1 '(extend-all Magma [(op ([x y] (% x y)))]

          Number        [op-number]
          [List Vector] [op-list]))

=> '(do (clojure.core/extend-type Number Magma (op ([x y] (op-number x y)))) (clojure.core/extend-type List Magma (op ([x y] (op-list x y)))) (clojure.core/extend-type Vector Magma (op ([x y] (op-list x y)))))

Transforms a protocl template into multiple extend-type expresions

(macroexpand-1
 '(extend-all Magma
              [(op ([x y] (% x y)))]

              Number        [op-number]
              [List Vector] [op-list]))
=> '(do (clojure.core/extend-type Number Magma (op ([x y] (op-number x y))))
        (clojure.core/extend-type List Magma (op ([x y] (op-list x y))))
       (clojure.core/extend-type Vector Magma (op ([x y] (op-list x y)))))
raw docstring

extend-implementationscljmacro

(extend-implementations protocolsyms & {:as options})

Creates a set of implementation functions for implementation of protocol functionality

(extend-implementations [IData] :wrappers (fn [form _] (list 'str form " again")))

(data (map->Envelope {:hello "world"})) => "hello world again"

Creates a set of implementation functions for implementation
of protocol functionality

(extend-implementations
 [IData]
 :wrappers (fn [form _]
             (list 'str form " again")))

(data (map->Envelope {:hello "world"}))
=> "hello world again"
raw docstring

includecljmacro

(include & [opts? & sources])

Imports all or a selection of vars from one namespace to the current one.

(include (hara.core.base.check atom? long?)) (eval '(long? 1)) => true (eval '(atom? 1)) => false

(include {:fn (fn [ns sym var] (intern ns sym (fn [x] (@var (bigint x)))))} (hara.core.base.check bigint?)) (eval '(bigint? 1)) => true

(include {:ns 'clojure.core} (hara.core.base.check bigint?)) => [#'clojure.core/bigint?]

Imports all or a selection of vars from one namespace to the current one.

(include (hara.core.base.check atom? long?))
(eval '(long? 1))  => true
(eval '(atom? 1)) => false

(include
 {:fn (fn [ns sym var]
        (intern ns sym (fn [x] (@var (bigint x)))))}
 (hara.core.base.check bigint?))
(eval '(bigint? 1)) => true

(include
 {:ns 'clojure.core}
 (hara.core.base.check bigint?))
=> [#'clojure.core/bigint?]

raw docstring

(link & [opts? & sources])

creates links to vars that can be resolved in a controllable manner

(link {:resolve :lazy} (hara.core.base.check atom?))

(meta #'atom?) => {:name 'atom?, :ns ns}

creates links to vars that can be resolved in a controllable manner

(link
 {:resolve :lazy}
 (hara.core.base.check atom?))

(meta #'atom?) => {:name 'atom?, :ns *ns*}
raw docstring

registered-link?clj

(registered-link? link)

checks if a link is registered

(registered-link? -lnk-) => false

checks if a link is registered

(registered-link? -lnk-)
=> false
raw docstring

(registered-links)
(registered-links registry)

returns all registered links

(register-link -lnk-) => #'hara.module.base.link-test/-lnk-

(registered-links) => (contains [(exactly #'-lnk-)])

returns all registered links

(register-link -lnk-)
=> #'hara.module.base.link-test/-lnk-

(registered-links)
=> (contains [(exactly #'-lnk-)])
raw docstring

(resolve-links)
(resolve-links registry)

resolves all unresolved links in a background thread

(resolve-links)

resolves all unresolved links in a background thread

(resolve-links)
raw docstring

(unresolved-links)
(unresolved-links registry)

returns all unresolved links

(unresolved-links)

returns all unresolved links

(unresolved-links)
raw docstring

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

× close