Immutability

38 views
Skip to first unread message

Traroth

unread,
Jul 11, 2012, 6:32:16 PM7/11/12
to erj...@googlegroups.com
In Erlang, all data are supposed to be immutable. How do you manage in Java where immutability is almost impossible to enforce? What are the consequence of this situation for Erjang?

Tony Arcieri

unread,
Jul 11, 2012, 7:19:03 PM7/11/12
to erj...@googlegroups.com
On Wed, Jul 11, 2012 at 3:32 PM, Traroth <tra...@gmail.com> wrote:
In Erlang, all data are supposed to be immutable. How do you manage in Java where immutability is almost impossible to enforce? What are the consequence of this situation for Erjang?

If you choose not to implement mutation in your programming language, you have immutable state by default. The computer any immutable language runs on top of uses mutable state, but if a programming language doesn't expose mutation as a feature, users of your language will be unable to utilize the underlying computer's ability to mutate state. The same goes for the JVM.

--
Tony Arcieri

Reply all
Reply to author
Forward
0 new messages