Liking cljdoc? Tell your friends :D

pallet.thread-expr

Macros that can be used in an expression thread.

Macros that can be used in an expression thread.
raw docstring

-->cljmacro

(--> & forms)

Similar to clojure.core/->, with added symbol macros for the various threading macros found in pallet.thread-expr. Currently supported symbol macros are:

  • binding

  • for

  • let

  • when, when-not, when-let

  • if, if-not

  • apply

  • expose-request-as (bound to pallet.thread-expr/arg->

    Examples:

    (--> 5 (let [y 1] (for [x (range 3)] (+ x y))) (+ 1)) => 12

    (--> 5
         (expose-request-as [x] (+ x))
         (+ 1))
    

=> 11

Similar to `clojure.core/->`, with added symbol macros for the
  various threading macros found in `pallet.thread-expr`. Currently
  supported symbol macros are:

* binding
* for
* let
* when, when-not, when-let
* if, if-not
* apply
* expose-request-as (bound to `pallet.thread-expr/arg->`

    Examples:

     (--> 5
        (let [y 1]
          (for [x (range 3)]
            (+ x y)))
        (+ 1))
 => 12

      (--> 5
           (expose-request-as [x] (+ x))
           (+ 1))
 => 11
sourceraw docstring

-->>cljmacro

(-->> & forms)

Similar to clojure.core/->>, with added symbol macros for the various threading macros found in pallet.thread-expr. Currently supported symbol macros are:

  • binding

  • for

  • let

  • when, when-not, when-let

  • if, if-not

  • apply

  • expose-request-as (bound to pallet.thread-expr/arg->>

    Examples:

    (-->> 5 (let [y 1] (for [x (range 3)] (+ x y))) (+ 1)) => 12

    (-->> 5
          (expose-request-as [x] (+ x))
          (+ 1))
    

=> 11

Similar to `clojure.core/->>`, with added symbol macros for the
  various threading macros found in `pallet.thread-expr`. Currently
  supported symbol macros are:

* binding
* for
* let
* when, when-not, when-let
* if, if-not
* apply
* expose-request-as (bound to `pallet.thread-expr/arg->>`

    Examples:

     (-->> 5
         (let [y 1]
           (for [x (range 3)]
             (+ x y)))
         (+ 1))
 => 12

      (-->> 5
            (expose-request-as [x] (+ x))
            (+ 1))
 => 11
sourceraw docstring

apply->cljmacro

(apply-> arg f & arg-coll)

Apply in a threaded expression. e.g. (-> 1 (apply-> + [1 2 3])) => 7

Apply in a threaded expression.
e.g.
   (-> 1
     (apply-> + [1 2 3]))
=> 7
sourceraw docstring

apply->>cljmacro

(apply->> f & arg-coll)

Apply in a threaded expression. e.g. (->> 1 (apply->> + [1 2 3])) => 7

Apply in a threaded expression.
e.g.
   (->> 1
      (apply->> + [1 2 3]))
=> 7
sourceraw docstring

apply-map->cljmacro

(apply-map-> arg f & arg-coll)

Apply in a threaded expression. e.g. (-> :a (apply-map-> hash-map 1 {:b 2})) => {:a 1 :b 2}

Apply in a threaded expression.
e.g.
   (-> :a
     (apply-map-> hash-map 1 {:b 2}))
=> {:a 1 :b 2}
sourceraw docstring

apply-map->>cljmacro

(apply-map->> f & arg-coll)

Apply in a threaded expression. e.g. (->> :a (apply-map->> hash-map 1 {:b 2})) => {:a 1 :b 2}

Apply in a threaded expression.
e.g.
   (->> :a
      (apply-map->> hash-map 1 {:b 2}))
=> {:a 1 :b 2}
sourceraw docstring

arg->cljmacro

(arg-> arg [sym] & body)

Lexically assign the threaded argument to the specified symbol.

(-> 1 (arg-> [x] (+ x)))

=> 2

Lexically assign the threaded argument to the specified symbol.

(-> 1
  (arg-> [x] (+ x)))

=> 2
sourceraw docstring

arg->>cljmacro

(arg->> [sym] & body)

Lexically assign the threaded argument to the specified symbol.

(->> 1 (arg->> [x] (+ x)))

=> 2

Lexically assign the threaded argument to the specified symbol.

(->> 1
   (arg->> [x] (+ x)))

=> 2
sourceraw docstring

binding->cljmacro

(binding-> arg bindings & body)

A binding form that can appear in a request thread. eg. (def a 0) (-> 1 (binding-> [a 1] (+ a))) => 2

A `binding` form that can appear in a request thread.
eg.
   (def *a* 0)
   (-> 1
     (binding-> [*a* 1]
       (+ *a*)))
=> 2
sourceraw docstring

binding->>cljmacro

(binding->> bindings & body)

A binding form that can appear in a request thread. eg. (def a 0) (->> 1 (binding->> [a 1] (+ a))) => 2

A `binding` form that can appear in a request thread.
eg.
   (def *a* 0)
   (->> 1
      (binding->> [*a* 1]
        (+ *a*)))
=> 2
sourceraw docstring

for->cljmacro

(for-> arg seq-exprs & body)

Apply a thread expression to a sequence. eg. (-> 1 (for-> [x [1 2 3]] (+ x))) => 7

Apply a thread expression to a sequence.
eg.
   (-> 1
     (for-> [x [1 2 3]]
       (+ x)))
=> 7
sourceraw docstring

for->>cljmacro

(for->> seq-exprs & body)

Apply a thread expression to a sequence. eg. (->> 1 (for->> [x [1 2 3]] (+ x))) => 7

Apply a thread expression to a sequence.
eg.
   (->> 1
      (for->> [x [1 2 3]]
        (+ x)))
=> 7
sourceraw docstring

if->cljmacro

(if-> arg condition form)
(if-> arg condition form else-form)

An if form that can appear in a request thread eg. (-> 1 (if-> true (+ 1) (+ 2))) => 2

An `if` form that can appear in a request thread
eg.
   (-> 1
     (if-> true
       (+ 1)
       (+ 2)))
=> 2
sourceraw docstring

if->>cljmacro

(if->> condition form arg)
(if->> condition form else-form arg)

An if form that can appear in a request thread eg. (->> 1 (if->> true (+ 1) (+ 2))) => 2

An `if` form that can appear in a request thread
eg.
   (->> 1
      (if->> true
        (+ 1)
        (+ 2)))
=> 2
sourceraw docstring

if-not->cljmacro

(if-not-> arg condition form)
(if-not-> arg condition form else-form)

An if-not form that can appear in a request thread eg. (-> 1 (if-not-> true (+ 1) (+ 2))) => 3

An `if-not` form that can appear in a request thread
eg.
   (-> 1
     (if-not-> true
       (+ 1)
       (+ 2)))
=> 3
sourceraw docstring

if-not->>cljmacro

(if-not->> condition form arg)
(if-not->> condition form else-form arg)

An if-not form that can appear in a request thread eg. (->> 1 (if-not->> true (+ 1) (+ 2))) => 3

An `if-not` form that can appear in a request thread
eg.
   (->> 1
      (if-not->> true
        (+ 1)
        (+ 2)))
=> 3
sourceraw docstring

let->cljmacro

(let-> arg binding & body)

A let form that can appear in a request thread. eg. (-> 1 (let-> [a 1] (+ a))) => 2

A `let` form that can appear in a request thread.
eg.
   (-> 1
     (let-> [a 1]
       (+ a)))
=> 2
sourceraw docstring

let->>cljmacro

(let->> binding & body)

A let form that can appear in a request thread. eg. (->> 1 (let->> [a 1] (+ a))) => 2

A `let` form that can appear in a request thread.
eg.
   (->> 1
      (let->> [a 1]
        (+ a)))
=> 2
sourceraw docstring

let-with-arg->cljmacro

(let-with-arg-> arg arg-symbol binding & body)

A let form that can appear in a request thread, and assign the value of the threaded arg.

eg. (-> 1 (let-with-arg-> val [a 1] (+ a val))) => 3

A `let` form that can appear in a request thread, and assign the
value of the threaded arg.

eg.
   (-> 1
     (let-with-arg-> val [a 1]
       (+ a val)))
=> 3
sourceraw docstring

let-with-arg->>cljmacro

(let-with-arg->> arg-symbol binding & body)

A let form that can appear in a request thread, and assign the value of the threaded arg.

eg. (->> 1 (let-with-arg->> val [a 1] (+ a val))) => 3

A `let` form that can appear in a request thread, and assign the
value of the threaded arg.

eg.
   (->> 1
      (let-with-arg->> val [a 1]
        (+ a val)))
=> 3
sourceraw docstring

when->cljmacro

(when-> arg condition & body)

A when form that can appear in a request thread. eg. (-> 1 (when-> true (+ 1))) => 2

A `when` form that can appear in a request thread.
eg.
   (-> 1
     (when-> true
       (+ 1)))
=> 2
sourceraw docstring

when->>cljmacro

(when->> condition & body)

A when form that can appear in a request thread. eg. (->> 1 (when->> true (+ 1))) => 2

A `when` form that can appear in a request thread.
eg.
   (->> 1
      (when->> true
        (+ 1)))
=> 2
sourceraw docstring

when-let->cljmacro

(when-let-> arg binding & body)

A when-let form that can appear in a request thread. eg. (-> 1 (when-let-> [a 1] (+ a))) => 2

A `when-let` form that can appear in a request thread.
eg.
   (-> 1
     (when-let-> [a 1]
       (+ a)))
=> 2
sourceraw docstring

when-let->>cljmacro

(when-let->> binding & body)

A when-let form that can appear in a request thread. eg. (->> 1 (when-let->> [a 1] (+ a))) => 2

A `when-let` form that can appear in a request thread.
eg.
   (->> 1
      (when-let->> [a 1]
        (+ a)))
=> 2
sourceraw docstring

when-not->cljmacro

(when-not-> arg condition & body)

A when-not form that can appear in a request thread. eg. (-> 1 (when-not-> true (+ 1))) => 1

A `when-not` form that can appear in a request thread.
eg.
   (-> 1
     (when-not-> true
       (+ 1)))
=> 1
sourceraw docstring

when-not->>cljmacro

(when-not->> condition & body)

A when-not form that can appear in a request thread. eg. (->> 1 (when-not->> true (+ 1))) => 1

A `when-not` form that can appear in a request thread.
eg.
   (->> 1
      (when-not->> true
        (+ 1)))
=> 1
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close