you are absolutely right about StringBuilder
! ( in the book it is the next thing he explains )
but really what i was wondering about is this…
so, a clj sting is a java str… and so if java changes how string is internally implemented ( say you move from char[]
to byte[]
- as it happened - ) that change will affect clj as well. also the cache for string literals seams to work the same way…
okay, now suppose someone changed the internals of the java string class in such a way that it would move from an array of some sort to a persistent char sequence… alla clj…
what would one have to suspect would happen? ( for example seams to me that that example with the concatenation would not be much of a performance issue any more at all… even keeping the immutable property in tact… )
does that make sense?