© Gary D. Knott 2017

Gary D. Knott, Interpreting LISP, 10.1007/978-1-4842-2707-7_12

12. Defining Functions: λ-Expressions

Gary D. Knott

(1)Civilized Software Inc., Silver Spring, Maryland, USA

We can use the LISP interpreter to compute the value of combinations of built-in functions and special forms applied to arguments, but to use LISP as a programming language rather than as a curious kind of calculator, we must have a way to define functions of our own choosing and use them, rather than just use unnamed compositions of preexisting functions.

The special form LAMBDA is used in LISP to create a user-defined function. LAMBDA takes two arguments, which are both S-expressions. The first argument is a list of ordinary atoms denoting the formal arguments ...

Get Interpreting LISP: Programming and Data Structures, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.