Generic Setter Guild Supply Ship

Lisp Dialect

Common Lisp


To modify the value of a variable in Common Lisp, you use setf. However, this command also has an amazing special power: Instead of a variable name, you can pass it a complex Lisp expression that retrieves a value. It can then turn that expression “inside out” and use it to modify that value, rather than simply retrieve it. These types of expressions are called generic setters.

image with no caption

Many commands besides setf also support generic setters. Using this feature, most types of data structures can get by without any specific “setting” functions of their own.

How It Kills Bugs

When you have a complicated, ...

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

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