Liking cljdoc? Tell your friends :D
Clojure only.

hara.function.base.dispatch


callclj

(call obj)
(call obj f)
(call obj f v1)
(call obj f v1 v2)
(call obj f v1 v2 v3)
(call obj f v1 v2 v3 v4)
(call obj f v1 v2 v3 v4 & vs)

like invoke but reverses the function and first argument

(call 2) => 2

(call 2 + 1 2 3) => 8

like `invoke` but reverses the function and first argument

(call 2) => 2

(call 2 + 1 2 3) => 8
raw docstring

invokeclj

(invoke f)
(invoke f v1)
(invoke f v1 v2)
(invoke f v1 v2 v3)
(invoke f v1 v2 v3 v4)
(invoke f v1 v2 v3 v4 & vs)

Executes (f v1 ... vn) if f is not nil

(invoke nil 1 2 3) => nil

(invoke + 1 2 3) => 6

Executes `(f v1 ... vn)` if `f` is not nil

(invoke nil 1 2 3) => nil

(invoke + 1 2 3) => 6
raw docstring

messageclj

(message obj kw)
(message obj kw v1)
(message obj kw v1 v2)
(message obj kw v1 v2 v3)
(message obj kw v1 v2 v3 v4)
(message obj kw v1 v2 v3 v4 & vs)

Message dispatch for object orientated type calling convention.

(def obj {:a 10 :b 20 :get-sum (fn [this] (+ (:b this) (:a this)))})

(message obj :get-sum) => 30

Message dispatch for object orientated type calling convention.

(def obj {:a 10
          :b 20
          :get-sum (fn [this]
                     (+ (:b this) (:a this)))})

(message obj :get-sum) => 30
raw docstring

opclj

(op f & args)

loose version of apply. Will adjust the arguments to put into a function

(op + 1 2 3 4 5 6) => 21

(op (fn [x] x) 1 2 3) => 1

(op (fn [_ y] y) 1 2 3) => 2

(op (fn [_] nil)) => (throws Exception)

loose version of apply. Will adjust the arguments to put into a function

(op + 1 2 3 4 5 6) => 21

(op (fn [x] x) 1 2 3) => 1

(op (fn [_ y] y) 1 2 3) => 2

(op (fn [_] nil)) => (throws Exception)
raw docstring

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

× close