std.lib.impl
build-impl
macro
added in 3.0
(build-impl & body)build macro for generating functions from protocols
build-template-fn
added in 3.0
(build-template-fn {:keys [variadic with-opts], :as opts})contructs a template from returned vals with support for variadic
((build-template-fn {}) ’([-val (obj(val obj))] [-val (obj k(val obj k))] [-get (obj(get obj))])) => ’((clojure.core/defn val (obj(val obj)) (obj k(val obj k))) (clojure.core/defn get (obj(get obj))))
((build-template-fn {:variadic ’#{-mul}}) ’([-mul (obj ks(mul obj ks))])) => ’((clojure.core/defn mul (obj & ks(mul obj ks))))
build-template-protocol
added in 3.0
(build-template-protocol {:keys [protocol inner outer fns variadic with-opts], :as params})build-variadic-fn
added in 3.0
(build-variadic-fn fsym arr)builds a variadic function if indicated
build-with-opts-fn
added in 3.0
(build-with-opts-fn fsym arr)builds a function with an optional component
create-body-fn
added in 3.0
(create-body-fn {:keys [body-fn], :as fns})defimpl
macro
added in 3.0
(defimpl sym bindings & body)creates a high level deftype or defrecord interface
dimpl-template-interface
added in 3.0
(dimpl-template-interface {:keys [interface method body], :as params})dimpl-template-protocol
added in 3.0
(dimpl-template-protocol {:keys [protocol prefix suffix fns custom], :as params})eimpl-print-method
added in 3.0
(eimpl-print-method type string)creates a print method form
eimpl-template-fn
added in 3.0
(eimpl-template-fn inputs)eimpl-template-protocol
added in 3.0
(eimpl-template-protocol {:keys [protocol prefix suffix fns custom], :as params})impl:doto
added in 3.0
(impl:doto sym)impl:proxy
added in 3.0
(impl:proxy sym)impl:unwrap-sym
added in 3.0
(impl:unwrap-sym {:keys [name prefix suffix], :or {prefix "", suffix ""}})unwraps the protocol symbol
(impl:unwrap-sym {:name ’-val :prefix “test/” :suffix “-mock”}) => ’test/val-mock
impl:wrap-sym
added in 3.0
(impl:wrap-sym {:keys [protocol name]})wraps the protocol symbol
(impl:wrap-sym {:protocol ’protocol.test/ITest :name ’-val}) => ’protocol.test/-val
interface-fns
added in 3.0
(interface-fns type template)helper for interface forms
(interface-fns :body {}) => (contains {:body-output-fn fn?})
parse-impl
added in 3.0
(parse-impl signatures {:keys [method body include exclude], :as params})parses the different transform types
(parse-impl (template-signatures ’IHello {:prefix “impl/”}) {:body ’{-hi “Hi There”}}) => ’{:method #{}, :body #{-hi}, :default #{-delete}}
protocol-fns
added in 3.0
(protocol-fns type template)helpers for protocol forms
(protocol-fns :body {}) => (contains {:body-output-fn fn?})
split-all
added in 3.0
(split-all forms)(split-all forms tag-key)(split-all forms tag-key params)split-body
added in 3.0
(split-body body)split-single
added in 3.0
(split-single forms)(split-single forms tag-key)splits out a given entry
standard-body-input-fn
added in 3.0
(standard-body-input-fn _)creates a standard input function
standard-body-output-fn
added in 3.0
(standard-body-output-fn {:keys [body-sym-fn body-arg-fn], :or {body-sym-fn :name, body-arg-fn identity}})creates a standard output function
template-gen
added in 3.0
(template-gen type-fn types signatures params fns)template-signatures
added in 3.0
(template-signatures protocol)(template-signatures protocol params)finds template signatures for a protocol
template-transform
added in 3.0
(template-transform signatures {:keys [template-fn], :as fns, :or {template-fn identity}})transforms all functions