On Monday, 25 March 2013 18:07:33 UTC+5:30, Jim foo.bar wrote:
>
> On 25/03/13 12:28, Michael Klishin wrote: 
> > There is no absolute immutability on the JVM, .NET, in JavaScript. 
> > There is always a backdoor to mutability. 
> > But 99.9% of projects won't use it. 
>
> Andy hinted this last night as well...is this true? if I declare a 
> Integer/String object as private & final within a class, is there a way 
> to mutate it? I do find this very scary, even in Java as it contradicts 
> certain things we take for granted... 
>


Yes. Unless somebody has implemented a granular strict security model, it 
is possible to use reflection and mutate stuff. For example, this is a 
popular mechanism to read and write private fields:

http://docs.oracle.com/javase/7/docs/api/java/lang/reflect/AccessibleObject.html#setAccessible(boolean)

I have seen Clojure's Java source code is very good quality code and there 
are many things that you can mutate to make things look bad. That is simply 
because that's how Java is. However, I'd consider they are just 
implementation details and intended for idiomatic use from within the 
Clojure language.

Shantanu

-- 
-- 
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