On Thursday, December 26, 2013 9:18:06 PM UTC+1, Luc wrote:
>
> Now you could create un mutable 
> objects but then why bother 
> creating classes with hidden 
> behaviours if there is no hidden 
> state ? 
>

The state is still hidden. Even if the state is immutable:
1) other code could access it and, thus, changing the inner working of your 
class would break that code;
2) other code could create a new instance of your class with inconsistent 
internal state.
As you can see, immutability is totally orthogonal to object orientation. 
Encapsulation is still useful, as are inheritance and polymorphism.

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to