O'Reilly logo

Land of Lisp by Conrad Barski M.D.

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hash Tables

In the same way that arrays are sort of like lists, hash tables are sort of like alists, except that they also allow you to access arbitrary elements more quickly.

In fact, hash tables are so efficient that they can, at times, seem like magic. Think of the Babel fish in the Hitchhiker’s Guide to the Galaxy trilogy—something so impossibly useful that it really has no business existing in the first place. That’s why almost all modern languages now offer the hash table datatype.

image with no caption

Working with Hash Tables

Create a new hash table with the make-hash-table command:

> (make-hash-table)
#S(HASH-TABLE ...)

Like alists, hash tables store items using ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required