jan tolenaar / kiezellisp / index-of-everything

Name

chain

Usage

macro

Syntax

(chain (sym) form*)

Description

Evaluates the forms and returns the value of the last form. The value of each form is stored in the variable ~ which can be referenced by the next form.

make-html > (chain (~)
                "een twee drie vier vijf zes zeven"
                (.split ~)
                (map .length ~)
                (sum ~))
it: 27
make-html > (sum (map .length (.split "een twee drie vier vijf zes zeven")))
it: 27