2 ms·
Clojure's data structures handle this by sharing state across different copies of the structure. So say I have a hashmap with 15 k/v pairs in it, then I change
by runevault 17y ago
Clojure's data structures handle this by sharing state across different copies of the structure. So say I have a hashmap with 15 k/v pairs in it, then I change one of the values in an existing key. Only the path to and that k/v pair are changed, the rest are just pointers to the same items that were already existing, minimizing the cost of "changing" it and allowing concurrency to still work without contention issues.