thingy.core

Instantiate thingy objects and assign their invocation function.

Example:

  1. Create thingy instance.

    (def a-thingy (make-thingy :a :b))
    
    a-thingy ;; => [:a :b]
    
  2. 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))
    
  3. Assign the thingy invocation function.

    (assign-thingy-fn! foo)
    
  4. 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.

assign-thingy-fn!

(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.

make-thingy

(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.