thread-as: Threading a value, bound to a symbol, through expressions

Description Usage Arguments Examples

Description

See https://clojuredocs.org/clojure.core/as->.

Usage

1
"as->"(value, symbol, ...)

Arguments

value

An initial value.

symbol

An unquoted symbol name which will be replaced by the values returned by the previous expressions.

...

The expressions, most likely including the symbol defined in symbol (possibly nested).

Examples

1
2
3
4
5
6
7
`as->`(1000, nn,
       mean(c(1,nn)),
       sum(c(nn,5)),
       `-`(nn,13))
# Is transformed to:
# sum(c(mean(c(1, 1000)), 5)) - 13
# an evaluates to 492.5.

alekrutkowski/clojR documentation built on May 11, 2019, 11:24 p.m.