A detailed explanation of how Clojure's persistent vectors work internally, covering the core tree-based structure and three fundamental operations: updates (assoc), appends (conj), and popping. The post explains path copying as the key mechanism for achieving persistence without copying the entire structure, describes three edge cases for both appends and pops (including root overflow and root killing), and clarifies why the 32-way branching factor makes operations effectively O(1) despite being technically O(log n).
Sort: