<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=""><blockquote type="cite" class="">On Feb 17, 2017, at 7:37 AM, David Hart <<a href="mailto:david@hartbit.com" class="">david@hartbit.com</a>> wrote:<br class=""></blockquote><div><blockquote type="cite" class=""><br class="Apple-interchange-newline"><div class=""><div style="font-family: Helvetica; font-size: 12px; 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="">On 17 Feb 2017, at 08:59, Nicolas Fezans via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:<br class=""><br class=""></div><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; 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-size-adjust: auto; -webkit-text-stroke-width: 0px;" class=""><div class=""><div dir="ltr" class="">> <span style="font-size: 12.800000190734863px;" class="">Not only that, but even if you pass a value type as a parameter, that value type might have reference types as ivars.</span><div class=""><span style="font-size: 12.800000190734863px;" class=""><br class=""></span></div><div class=""><span style="font-size: 12.800000190734863px;" class="">I think that arguments passed to a pure function shall be checked against containing such references or objects that contains such references themselves: I guess that this check could be made by the compiler.</span></div><div class=""><span style="font-size: 12.800000190734863px;" class="">Programmers will then have to see whether they choose a) to go to "pure value-type arguments" (i.e. not containing directly nor indirectly such references) and be able to declare some of their functions as pure or b) to keep these references and not declare the corresponding functions as pure.</span></div></div></div></blockquote><div style="font-family: Helvetica; font-size: 12px; 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=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px; 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="">Wouldn't we need a way to declare value semantics? Array has such references but has value semantics so should be fine, no?</div></div></blockquote></div><br class=""><div class="">Arrays can contain reference types. If you have an array of references, you can call a mutating function on one of them…</div><div class=""><br class=""></div><div class="">There’s also the other built-in value types that are backed by reference types: URL is backed by NSURL, Data is backed by NSData. They won’t mutate, because they’re set up to make sure they get immutable versions of them, but how is the compiler going to prove it?</div><div class=""><br class=""></div><div class="">Charles</div><div class=""><br class=""></div></body></html>