Liking cljdoc? Tell your friends :D

hara.function.base.invoke


+default-fn+clj


+default-packages+clj


definvokecljmacro

(definvoke name doc? & [attrs? & [params & body :as more]])

customisable invocation forms

(definvoke -another- [:compose {:val (partial + 10) :arglists '([& more])}])

customisable invocation forms

(definvoke -another-
  [:compose {:val (partial + 10)
            :arglists '([& more])}])
raw docstring

fncljmacro

(fn & body)

macro for an extensible fn form

(fn [x] x) => fn?

^{:type :function} (fn [x] x) => java.util.function.Function

^{:type :predicate} (fn [x] true) => java.util.function.Predicate

macro for an extensible `fn` form

(fn [x] x)
=> fn?

^{:type :function}
(fn [x] x)
=> java.util.function.Function

^{:type :predicate}
(fn [x] true)
=> java.util.function.Predicate
raw docstring

fn-bodyclj

(fn-body label body)

creates the anonymous function body

(fn-body :function '([x] x)) => '(clojure.core/reify java.util.function.Function (toString [_] "([x] x)") (apply [_ x] x))

creates the anonymous function body

(fn-body :function '([x] x))
=> '(clojure.core/reify java.util.function.Function
      (toString [_] "([x] x)")
      (apply [_ x] x))
raw docstring

fn-body-clojureclj

(fn-body-clojure body)
(fn-body-clojure _ body)

creates the anonymous function body for a clojure fn

(fn-body-clojure '([x] x)) => '(clojure.core/fn [x] x)

creates the anonymous function body for a clojure fn

(fn-body-clojure '([x] x))
=> '(clojure.core/fn [x] x)
raw docstring

form-arglistsclj

(form-arglists body)

returns the arglists of a form

(form-arglists '([x] x)) => '(quote ([x]))

(form-arglists '(([x] x) ([x y] (+ x y)))) => '(quote ([x] [x y]))

returns the arglists of a form

(form-arglists '([x] x))
=> '(quote ([x]))

(form-arglists '(([x] x) ([x y] (+ x y))))
=> '(quote ([x] [x y]))
raw docstring

invoke-internclj

(invoke-intern label name config body)

main function to call for definvoke

(invoke-intern :method '-hello-method- {:multi '-hello-multi- :val :apple} '([x] x)) => '(clojure.core/let [v (def -hello-method- (clojure.core/fn -hello-method- [x] x))] [(hara.function.base.multi/multi-add -hello-multi- :apple -hello-method-) v])

main function to call for `definvoke`

(invoke-intern :method
               '-hello-method-
               {:multi '-hello-multi-
                :val :apple}
               '([x] x))
=> '(clojure.core/let [v (def -hello-method- (clojure.core/fn -hello-method- [x] x))]
      [(hara.function.base.multi/multi-add -hello-multi- :apple -hello-method-) v])
raw docstring

invoke-intern-composeclj

(invoke-intern-compose _ name {:keys [val arglists] :as config} _)

method body for :compose form

(invoke-intern-compose :compose '-compose-form- {:val '(partial + 1 2) :arglists ''([& more])} nil)

method body for `:compose` form

(invoke-intern-compose :compose
                       '-compose-form-
                      {:val '(partial + 1 2)
                        :arglists ''([& more])} nil)
raw docstring

invoke-intern-dynamicclj

(invoke-intern-dynamic _ name config _)

constructs a body for the :dynamic keyword

(invoke-intern-dynamic nil '-hello- {:val :world} nil)

constructs a body for the :dynamic keyword

(invoke-intern-dynamic nil '-hello- {:val :world} nil)
raw docstring

invoke-intern-fnclj

(invoke-intern-fn _ name config body)

method body for :fn invoke

(invoke-intern-fn :fn '-fn-form- {} '([x] x))

method body for `:fn` invoke

(invoke-intern-fn :fn '-fn-form- {} '([x] x))
raw docstring

invoke-intern-lookupclj

(invoke-intern-lookup _
                      name
                      {:keys [table in out not-found arglists] :as config}
                      _)

method body for :lookup form

(invoke-intern-lookup :lookup '-lookup-form- {:table {:a 1 :b 2}} nil)

method body for `:lookup` form

(invoke-intern-lookup :lookup
                      '-lookup-form-
                     {:table {:a 1 :b 2}} nil)
raw docstring

invoke-intern-macroclj

(invoke-intern-macro _ name {:keys [args fn] :as config} _)

method body for :macro form

(defn -macro-fn- [] '[(fn [x] x) {:arglists ([x])}])

(invoke-intern-macro :macro '-macro-form- {:fn '-macro-fn- :args []} nil)

method body for `:macro` form

(defn -macro-fn- [] '[(fn [x] x)
                      {:arglists ([x])}])

(invoke-intern-macro :macro
                     '-macro-form-
                     {:fn '-macro-fn-
                      :args []}
                     nil)
raw docstring

invoke-intern-methodclj

(invoke-intern-method name {:keys [multi val] :as config} body)

creates a :method form, similar to defmethod

(defmulti -hello-multi- identity) (invoke-intern-method '-hello-method- {:multi '-hello-multi- :val :apple} '([x] x))

creates a `:method` form, similar to `defmethod`

(defmulti -hello-multi- identity)
(invoke-intern-method '-hello-method-
                      {:multi '-hello-multi-
                       :val :apple}
                      '([x] x))
raw docstring

invoke-intern-multiclj

(invoke-intern-multi _ name {:keys [refresh default hierarchy] :as config} body)

method body for :multi form

(invoke-intern-multi :multi '-multi-form- {} '([x] x))

method body for `:multi` form

(invoke-intern-multi :multi '-multi-form- {} '([x] x))
raw docstring

resolve-methodclj

(resolve-method mmethod pkgmethod label lookup)

resolves a package related to a label

(resolve-method protocol.function/-invoke-intern protocol.function/-invoke-package :fn +default-packages+) => nil

resolves a package related to a label

(resolve-method protocol.function/-invoke-intern
                protocol.function/-invoke-package
                :fn
                +default-packages+)
=> nil
raw docstring

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

× close