Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

The Fundamental Nature of Proplists

Proplists possess several characteristics that have kept them relevant despite the arrival of more sophisticated alternatives:

  • Order matters: The first occurrence of a key takes precedence over later ones, which means you can override defaults simply by consing new options onto the front. This is democracy in action, except with a first-past-the-post system that would make electoral reformers weep.

  • Atoms as boolean shorthand: An atom foo in a proplist is semantically equivalent to {foo, true}, which saves typing and looks cleaner when you have many boolean flags. It’s the data structure equivalent of saying “yes” instead of “the answer to your question is affirmative.”

  • Inheritance patterns: Proplists excel at representing inherited properties—options passed to functions where user preferences override system defaults, object properties, annotations, and the sort of hierarchical configuration that makes software configurable rather than merely programmable.

  • Literal equality: Two keys are considered equal if they match literally (=:=). This means 1 and 1.0 are different keys, which could be either a feature or a trap, depending on how caffeinated you were when you wrote the code.