<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">ok, I understand, thank you<div class="">TedvG<br class=""><div style=""><blockquote type="cite" class=""><div class="">On 25 Feb 2017, at 00:25, David Sweeris &lt;<a href="mailto:davesweeris@mac.com" class="">davesweeris@mac.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class=""><br class=""><blockquote type="cite" class="">On Feb 24, 2017, at 13:41, Ted F.A. van Gaalen &lt;<a href="mailto:tedvgiosdev@gmail.com" class="">tedvgiosdev@gmail.com</a>&gt; wrote:<br class=""><br class="">Hi David &amp; Dave<br class=""><br class="">can you explain that in more detail?<br class=""><blockquote type="cite" class=""><blockquote type="cite" class="">Wouldn’t that turn simple character access into a mutating function?<br class=""></blockquote></blockquote><br class="">assigning like &nbsp;&nbsp;s[11…14] = str &nbsp;is of course, yes.<br class="">only then - that is if the character array thus has been changed - <br class="">it has to update the string in storage, yes. <br class=""><br class="">but &nbsp;str = s[n..&lt;m] &nbsp;&nbsp;doesn’t. mutate.<br class="">so you’d have to maintain keep (private) a isChanged: Bool or bit.<br class="">a checksum over the character array . &nbsp;<br class="">?<br class=""></blockquote><br class="">It mutates because the String has to instantiate the Array&lt;Character&gt; to which you're indexing into, if it doesn't already exist. It may not make any externally visible changes, but it's still a change.<br class=""><br class="">- Dave Sweeris </div></div></blockquote></div><br class=""></div></body></html>