Mike Zamansky has popped in with another Learning Elisp video before he departs on his vacation. He didn’t want to start the next project and leave it hanging while he was away so this video covers some preliminaries. In particular, he covers some Elisp builtin data structures. That includes lists, pairs, vectors, hash tables, and association lists.
Vectors and hash tables have direct analogs in other languages and are probably familiar to all Irreal readers. Lists are simply linked lists and although they don’t have a builtin analog in most other languages, the idea is a common and familiar.
Zamansky explains how lists and pairs (single, unlinked cons cells) are implemented and then goes on to discuss the data structure that he’s planning to use in the next project: association lists. They’re sort of an intermediate structure, a bit like hash tables but lighter weight and not as fast. They’re the ideal key/value lookup method for small tables. It’s \(O(n)\) instead of the \(O(1)\) that hash tables provide but it’s perfect for relatively small lookup tables.
The next project is going to be about inserting emoji into a buffer and Zamansky is planning on using an association list to map the emoji name to the actual symbol. We’ll have to wait until Zamansky gets back from Europe for that but we can consider this video a teaser.
The video is 16 minutes, 16 seconds long so plan accordingly.