Endless Parentheses

Ramblings on productivity and technical subjects.

profile for Malabarba on Stack Exchange

New in Emacs 25.1: map.el library

Another library by the productive Nicolas Petton. map.el is a cousin to seq.el (remember?), but instead of manipulating plain sequences, it manipulates map-like collections (also known as dictionaries).

The range of functions should include everything you expect, from map-values and map-keys to get a list of the values and keys (duh), to general getters and setters like map-elt and map-put. Inside it, you’ll even find some fancier stuff like map-let, map-values-apply, or map-nested-elt. For those who know what that means, it also comes with a pcase macro!

Note that this library does not introduce a new data structure. It simply provides a consistent and unified API for dealing with any map-like structure you need. This applies to alists, hash-maps, and even vectors (it treats the vector as a dictionary whose keys are all integers).

Tags: emacs-25, emacs,

comments powered by Disqus