jan tolenaar / kiezellisp / index-of-everything

Name

lambda

Usage

special-form

Syntax

(lambda (arg*) form*)

Description

The special form lambda and the reader macro #(...) define anonymous functions.

make-html > (lambda (x y) (+ x y))
it: #<Lambda Name="anonymous">
make-html > (it 21 34)
it: 55
make-html > #(+ %1 %2)
it: #<Lambda Name="anonymous">
make-html > (it 21 34)
it: 55
make-html > (defun adder (n) #(+ n %1))
it: adder
make-html > (def g (adder 2))
it: g
make-html > (g 3)
it: 5

The code of a lambda is contained within a block lambda. Therefore return is equivalent to leave lambda.

See also

about:parameters defun defun* lambda lambda* return