chickadee » clojurian » ->

(-> val (proc args ...) ...)syntax
(->* val (proc args ...) ...)syntax

Inserts val as the first argument of the first (proc args ...) clause. The resulting form is then inserted as the first argument of the following proc form and so on. This is known as the thrush combinator. The starred version (->*) is multi value aware, i.e. each form's return values are spliced into the argument list of the successing form. As a shorthand it is also possible to pass proc instead of (proc).

Single value example:

(-> 10 (- 2) (/ 5) (* 3))

=>

(* (/ (- 10 2) 5) 3)

Multi value example:

(->* (values 1 2) (list))

=>

(receive args (values 1 2) (apply list args))