Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Function Types

TypeDescription
FunctionFirst-class function value
ClosureFunction with captured environment
Module FunctionReference to module function

Function Values:

;; Lambda creates function value
(let ((f (lambda (x) (* x 2))))
  (funcall f 5))  ; → 10

;; Function reference
(let ((f (function lists reverse 1)))
  (funcall f '(1 2 3)))  ; → (3 2 1)

;; Closure (captures x)
(let ((x 10))
  (lambda (y) (+ x y)))