(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])}])(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(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))(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)
(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]))
(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])(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)(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)(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))(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)(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)(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))(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))(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+)
=> nilcljdoc 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 |