2013/3/25 Jim foo.bar <jimpil1...@gmail.com> > OMG! I read your message very quickly late last night and honestly I > thought you were pulling my leg...I just tried this at a repl though, and > you're indeed right...Am I the only one who finds this slightly disturbing? > For almost 4 years, I've been hearing of how beautifully immutable (and > performant) clojure's data-structures are. Being able to modify a vector > in-place contradicts all that doesn't it? How can something be immutable > when it exposes a public field (.tail) that can be mutated in place? Why is > tail public anyway?
A quick inspection of call sites in IDE suggests it is public only to allow transient vectors to use it (I am not sure what the trade offs of making it protected would be). In any case, it is an implementation detail that is not supposed to be used and is simply not known to most developers. Just like in any other language, using internal APIs gives you both freedom and extra responsibility. -- MK http://github.com/michaelklishin http://twitter.com/michaelklishin -- -- 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.