You are previewing Land of Lisp.

Land of Lisp

Cover of Land of Lisp by Conrad Barski M.D. Published by No Starch Press

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)

Like alists, hash tables store items using ...

The best content for your career. Discover unlimited learning on demand for around $1/day.