4 ms·
Rich Hickey (re)popularized the usage of "persistent" to mean what you just described immutable as. That is, the previous version of the data structure "persist
by tree_of_item 12y ago
Rich Hickey (re)popularized the usage of "persistent" to mean what you just described immutable as. That is, the previous version of the data structure "persists" after you add an element, and now you have two values.
To the people using that definition of persistent, "immutable" just means constant, i.e. no insertion or deletion at all.
- ajanuary 12y agoTo give some more context, 'persistent data structures' is a standard term in the literature. The use of efficient persistent maps in Clojure, and the fact Rich Hickey explains that in most of the early Clojure introductory talks, has popularised it outside of academia.
- sgk284 12y agoThat's not quite right. All immutable data structures are persistent, but not all persistent data structures strictly use immutability. Immutability is a common way of achieving persistence, but fundamentally a persistent data structure simply preserves previous versions. This can be achieved through some mutability via things like fat nodes[1]. It turns out that when you use immutability, many other nice properties often fall out from that decision. You can absolutely insert and delete into an immutable data structure though. You'll simply get back a new structure. [1] http://en.wikipedia.org/wiki/Persistent_data_structure#Fat_Node http://en.wikipedia.org/wiki/Persistent_data_structure#Fat_N...