Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you do not care about mutability, you will only get immutable data. You can then send the data between different threads, and it will not get corrupted. The reason is that whenever you attempt to change them, a new instance of the structure being changed will be allocated.

There is a lot to recommend a functional programming style in general and forgoing mutation of data in particular, but these are programming practices. Clojure allows mutation. Common Lisp allows it in ways that are as mind blowingly difficult to grok as macros. The shared structure that allows efficient immutability semantics allows a tsunami of value changes if someone is careless or malicious.



Clojure allows mutation, but the data structures that use structural sharing aren't mutable.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: