Chapter 6.5. lambda: A Function So Important It Deserves Its Own Chapter

It’s impossible to overstate the importance of the lambda command in Lisp. In fact, this command is pretty much the entire reason that Lisp exists in the first place.

What lambda Does

In short, lambda lets you create a function without giving it a name. For example, let’s say we create a half function that takes a number and divides it in half. Until now, we’ve written such a function this way:

(defun half (n)
    (/ n 2))
image with no caption

It turns out that, in Lisp, functions are actually values that we can view and pass around just as if they were numbers or lists. An experienced Lisp programmer ...

Get Land of Lisp now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.