4 ms·
I may be misunderstanding your point, but that's just a well-done function which could be written in virtually any language, the advantage isn't inherent to Clo
by aaron-lebo 11y ago
I may be misunderstanding your point, but that's just a well-done function which could be written in virtually any language, the advantage isn't inherent to Clojure.
- natrius 11y agoThe difference is that in Clojure, `assoc-in` is effectively a deep copy as well since the data structures are immutable. Most of the complexity involved with nested maps is about the effects of modifying them. In practice, this doesn't exist in Clojure.
- nickbauman 11y ago> which could be written in virtually any language What natrius says is completely right on this point (which explains why those functions don't exist commonly outside of lisp) but it should by now make you wonder: if that's true, why haven't they?
- aaron-lebo 11y agoOH, I see your point. Thanks for the enlightenment.
- xiaoma 11y agoIt's not true. ImmutableJS is becoming very common, especially for React users: https://github.com/facebook/immutable-js/ https://github.com/facebook/immutable-js/
- dustingetz 11y agoPeople like to talk about immutable.js. It's not common.
- xiaoma 11y ago8k stars and counting. We used it at the last place I worked (a YC startup) and several of my friends report the same.