<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=""><br class=""><div><div class=""><div class="">On 26 Apr 2017, at 18:13, Ole Begemann &lt;<a href="mailto:ole@oleb.net" class="">ole@oleb.net</a>&gt; wrote:</div><br class="Apple-interchange-newline"></div><blockquote type="cite" class=""><div class=""><span style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">There have been requests for something like this on swift-evolution, e.g. here in the context of the discussion about a `reduce` variant that takes `inout` arguments:<span class="Apple-converted-space">&nbsp;</span></span><a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20170123/030641.html" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20170123/030641.html</a><br style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></blockquote><div><br class=""></div>Jonathan Hull is indeed asking for the same thing.<br class=""><br class=""><blockquote type="cite" class=""><div class=""><span style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">But as far as I know there hasn't been a proposal for adding this. (Is it important enough to have in the standard library? I don't know.)</span></div></blockquote></div><br class=""><div class="">I do it all the time!</div><div class=""><br class=""></div><div class="">BTW, it seems that the possibility to edit an array in this way isn’t mentioned explicitly anywhere in The Swift Programming Language.</div><div class=""><br class=""></div><div class="">Formally it requires two copies, like</div><div class=""><br class=""></div><div class="">myInstanceCopy = array[index]</div><div class="">myInstanceCopy.field = newValue</div><div class="">array[index] = &nbsp;myInstanceCopy</div><div class=""><br class=""></div><div class="">Jan E.</div></body></html>