Modifying data structures
Wait, I thought you said that data structures were immutable! So how can we change them then?
Yes, lists, vectors, maps and sets are all immutable. However, you can get a new data structure that has the changes you want. To make this approach efficient, the new data structure contains only the new data and links back to the existing data structure for shared data elements.
We will see some of the most common functions that work with data structures in this secion. In actuality, everything can be considered a function that works on a data structure though, as that is the language design of clojure.
当前内容版权归 practicalli 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 practicalli .