<div dir="ltr"><div>This is a topic of considerable history. See:</div><div><br></div><a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20151214/003684.html" target="_blank">https://lists.swift.org/<wbr>pipermail/swift-evolution/<wbr>Week-of-Mon-20151214/003684.<wbr>html</a><div><a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20151221/003900.html" target="_blank">https://lists.swift.org/<wbr>pipermail/swift-evolution/<wbr>Week-of-Mon-20151221/003900.<wbr>html</a></div><div><div><a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160104/006005.html" target="_blank">https://lists.swift.org/<wbr>pipermail/swift-evolution/<wbr>Week-of-Mon-20160104/006005.<wbr>html</a></div><div><a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160905/027010.html" target="_blank">https://lists.swift.org/<wbr>pipermail/swift-evolution/<wbr>Week-of-Mon-20160905/027010.<wbr>html</a></div><div><a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20170213/032076.html">https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20170213/032076.html</a></div><div><br></div><div>It would be important for those who wish to rekindle this discussion first to review and summarize the preceding, and very technically illuminating, discussions.</div><div><br></div><div><div><br></div><div class="gmail_extra"><div class="gmail_quote">On Thu, May 25, 2017 at 5:39 PM, Michael Savich via swift-evolution <span dir="ltr">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Writing functions without side effects is generally considered to result in less error-prone code. In Swift today, if you want to segment your code into pure and impure functions, you just have to police yourself, which is a very un-Swifty thing to have to do. This problem is compounded when working in teams, where someone else of course won’t know which of your functions are pure, and even if you leave a comment it’s not a guarantee they’ll know (or care) what “pure” means.<br>
<br>
So what about adding the ability to annotate functions with a special keyword? For example &quot;pure func addTwoNums(n1: Int, n2: Int)”.<br>
The rule here is very simple: functions annotated with “pure” can only call other functions annotated with “pure”, otherwise the compiler produces an error.<br>
<br>
To me, this feels like a very natural fit for Swift. What does everybody else think?<br>
______________________________<wbr>_________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailma<wbr>n/listinfo/swift-evolution</a><br>
</blockquote></div><br></div></div></div></div>