Instantiate thingy objects and assign their invocation function.
Example:
Create thingy instance.
(def a-thingy (make-thingy :a :b))
a-thingy ;; => [:a :b]
Define an invocation function, e.g., with defn
.
(defn foo
"A 3-arity example, concatenating three vector-like objects."
[x y z]
(concat x y z))
Assign the thingy invocation function.
(assign-thingy-fn! foo)
Test invocation behavior of the thingy.
(a-thingy [:c :d] [:e :f]) ;; => (:a :b :c :d :e :f)
Note: This evaluation concatenates a thingy instance, a-thingy
, with
two standard Clojure vectors.
Instantiate _thingy_ objects and assign their invocation function. Example: 1. Create _thingy_ instance. ```clojure (def a-thingy (make-thingy :a :b)) a-thingy ;; => [:a :b] ``` 2. Define an invocation function, e.g., with `defn`. ```clojure (defn foo "A 3-arity example, concatenating three vector-like objects." [x y z] (concat x y z)) ``` 3. Assign the _thingy_ invocation function. ```clojure (assign-thingy-fn! foo) ``` 4. Test invocation behavior of the _thingy_. ```clojure (a-thingy [:c :d] [:e :f]) ;; => (:a :b :c :d :e :f) ``` Note: This evaluation concatenates a _thingy_ instance, `a-thingy`, with two standard Clojure vectors.
(assign-thingy-fn! f)
Synchronously mutates the invocation function of all thingy instances to
function f
.
f
is a function with an arity of 0 to 9, inclusive. If f
accepts an
argument, the thingy instance is that first argument, followed by up to eight
additional arguments.
See also make-thingy
and thingy.core
.
Synchronously mutates the invocation function of all _thingy_ instances to function `f`. `f` is a function with an arity of 0 to 9, inclusive. If `f` accepts an argument, the thingy instance is that first argument, followed by up to eight additional arguments. See also [[make-thingy]] and [[thingy.core]].
(make-thingy & xs)
Given elements xs
, returns an instance of a thingy. Analogous to
clojure.core/vector
.
Example:
(make-thingy 1 2 3) ;; => [1 2 3]
See also assign-thingy-fn!
and thingy.core
.
Given elements `xs`, returns an instance of a _thingy_. Analogous to [`clojure.core/vector`](https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/vector). Example: ```clojure (make-thingy 1 2 3) ;; => [1 2 3] ``` See also [[assign-thingy-fn!]] and [[thingy.core]].
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close