Name

do

Usage

special-form

Syntax

(do form*)

Description

Evaluates the forms and returns the value of the last form. The body of a function is an implicit do block. Macros such as when and loop generate do blocks.

Description

The let and var special forms declare lexical or dynamic variables.

user 1 > (do
             (let x 3)
             (let y 2)
             (+ x y))
it: 5

Description

Use do to perform method chaining. The compiler creates the variable ~ automatically.

user 1 > (do
             "een twee   drie vier vijf zes zeven"
             (.split ~)
             (map .length ~)
             (sum ~))
it: 27
user 2 > (sum (map .length (.split "een twee   drie vier vijf zes zeven")))
it: 27